Manage Grub password

To Set GRUB password go throw the following steps.

Step-1
- Run the following command to generate the hash value\>

]# grub-md5-crypt

  password: < your password for grub >

  Retype password: < your password for grub > 

  $1$f48up0$EUS8Rx56rZyx2ebkQ2gmc1 ------> Hash value of your password that you have specified

 

Step-2  Now copy the hash value and paste it inside /boot/grub/grub.conf

]#  vim    /boot/grub/grub.conf

      or

]#  vim   /etc/grub.conf

 

# grub.conf generated by anaconda

# Note that you do not have to rerun grub after making changes to this file

# NOTICE: You have a /boot partition. This means that

# all kernel and initrd paths are relative to /boot/, eg.

# root (hd0,0)

# kernel /vmlinuz-version ro root=/dev/vol0/root

# initrd /initrd-version.img

#boot=/dev/sda

 

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu 

password --md5 $1$f48up0$EUS8Rx56rZyx2ebkQ2gmc1 

title

Red Hat Enterprise Linux Server (2.6.18-53.el5)

root (hd0,0)

kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/vol0/root rhgb quiet

initrd /initrd-2.6.18-53.el5.img 

 

ESC

:wq