How to change the grub password

If you don't want someone booting your machine without permission, you can add a password to your GRUB entries. You can add a password only to specific entries if you wish; this will require a user to enter a password before loading only those boot entries you protect. This method very useful for your server security. But if u forgot your GRUB password you can proceed bellow steps.


01. Login as root

02. create an new encrypted password for grub
[root@daddylinux~]#grub-md5-crypt
Password: ******
(uddika)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)


03. copy the new encrypted password by highlighting it using the mouse

04. Open the grub configuration file for editing
[root@daddylinux~]#nano /etc/grub.conf

05. Find this line
password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/

06. Replace with the following line (Right click the mouse to paste new password)
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)

07. Save this file
Ctrl + O

08. Exit the file
Ctrl + X

2 comments:

  1. Hi, what if you've forgotten the GRUB password? How do you recover from that?

    ReplyDelete
  2. Thanks for your nice post. I have configure it in Redhat 6.

    I have written a post related topic. Set password on Linux grub to secure root user | Redhat 6

    ReplyDelete