just edit the following line in config file "grub.conf"
password 'password'
Also if you want you can use encrypted password. To generate encrypted password enter the grub command line, either by pressing 'c' in the menu or by running 'grub' under Linux, then run the command 'md5crypt'. Enter your password, it will give you the encrypted form. and now the line should like
Code:password --md5 'password'
Example :
[root@localhost ~]# grubProbing devices to guess BIOS drives. This may take a long time.
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.]
grub> md5crypt
Password: ****** // shipon is the password Encrypted: $1$yGtX2/$cqOH/GCHjz5GDLvkxXj9B0
#boot=/dev/sdadefault=0timeout=5password --md5 $1$yGtX2/$cqOH/GCHjz5GDLvkxXj9B0