Software >> OS >> Unix >> Linux >> Red Hat Enterprise Linux >> Boot Loader >> grub >> How to protect grub with a password

 Set the password

 # grub-md5-crypt
Password: **********
Retype password: ********

oD/1$NklcucLPshZVoo5LvUYEp1

 Take note the md5 hash password

For example enter the line password -md5 <md5 hash> after timeout line

 # vi /boot/grub/menu.lst

 

# 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/sda3
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
password --md5 oD/1$NklcucLPshZVoo5LvUYEp1