Set GRUB Password on CentOS or Redhat RHEL

Set GRUB Password on CentOS or Redhat RHEL

GRUB Password

The default boot loader on Linux Centos and Redhat RHEL is GRUB. So it’s security if we can set the password to protect that. More details about GRUB Security and Linux Guide you can see in: http://linuxelearning.ithelpblog.com/

Step 1: Create password for GRUB , it should be MD5 hash password

[root@ITHelpBlog ~]# grub-md5-crypt
Password:
Retype password:
$1$TymMO1$CeMxRvw85qs3ei6x9Uvr20
[root@ITHelpBlog ~]#

Step 2: Copy MD5 string/hash you got in the screen and paste to GRUB configuration

[root@ITHelpBlog ~]# vi /boot/grub/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/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
password –md5 $1$TymMO1$CeMxRvw85qs3ei6x9Uvr20
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-358.2.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=UUID=5239d6c9-2742-4a94-b628-f71e0e442ea7 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.2.1.el6.x86_64.img
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=5239d6c9-2742-4a94-b628-f71e0e442ea7 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.el6.x86_64.img
[root@ITHelpBlog ~]#

Step 3: Reboot your Linux Box and you can see Password Option in GRUB Boot loader

[root@ITHelpBlog ~]# init 6

grub pass

 

Thanks for using IThelpblog.com.

 

 

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>