HOWTO password protect your GRUB

Procedure to password protect your grub menu is simple. Steps are mentioned below.

1. Use the command grub-md5-crypt to generate an encrypted password in MD5 (Message Digest Algorithm 5) format.

[root@localhost ~]# grub-md5-crypt
Password:
Retype password:
$1$POwoW$3.ean3fFinACXjN9Ch/qG/

2. Open your /boot/grub/grub.conf file and copy the encrypted password.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$POwoW$3.ean3fFinACXjN9Ch/qG/
title Fedora (2.6.23.1-42.fc8)
root (hd0,0)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/
initrd /boot/initrd-2.6.23.1-42.fc8.img

Enter the password --md5 ENCRYPTED-PASSWORD line just before the title line.

3. Restart your computer and to modify the GRUB menu first enter p and then enter the password that you encrypted.

4. Now your GRUB is MD5 password protected.

Add new comment

Want to contact me?

Life begins outside your comfort zone and that is where your courage is developed". Write to me by filling this form. For living I am an Atlassian Consultant who love both Jira and Drupal. I am the author of "Mastering JIRA" and "Mastering JIRA 7" books. I Love both JIRA and Drupal (a bit more). You can Write To Me and I will get back to you as soon as I can. Have a nice day!

Social Links

Subscribe to my mailing list.

Enter your email address: