HOW TO SET/CHANGE GRUB PASSWORD ON REDHAT/CENTOS/FEDORA
GRUB stands for [ Grand Unified Boot Loader ] is a bootloader package from the GNU Project. GRUB is the reference implementation of the Free Software Foundation’s Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system’s partitions.GRUB is a very important part of linux operating system from where we can perform so many administrative tasks and booting configurations, It is highly recommended that it should be protected by password.
In this artical we are going to see how to Set/Change the GRUB Bootloader password in Linux, So Let’s have a look at the steps to Set/Change GRUB Password.
STEP 1 >>
Reset the GRUB password by below command.
After above command it will ask to enter the password which will later on used as a password to unlock the GRUB.
So Enter the Password twice to protect the GRUB.
As we can see that after set the password it given a MD5 hash password which we need to paste in main configuration file of GRUB.
“/boot/grub/grub.conf” is the main configuration file of GRUB OR we can access the same file in different path i.e. “/boot/grub/menu.lst” which is the Symlink or Symbolic Link or Shortcut of the main file i.e. “/boot/grub/grub.conf“.
STEP 2 >>
Note: it’s highly recommended to do a backup of grub.conf file by using below command.
Now edit the “grub.conf” file with “vi” command.
Paste the MD5 hash password on “grub.conf” file, For Example :-
password –md5 <MD5 hash Password created created above>
In our Case it’s like below shown :-
Note :- (Paste the below line in “grub.conf” file below the hiddenmenu line as shown in Snapshot below)
password –md5 $1$.zE70/$pk4kZhx6Zu9IHz6.4m7Kf0
Now we successfully set the GRUB password, Now its time for Testing.
Also Read :
Reboot the system and press any key before 5 Seconds to interrupt the normal boot process to edit the GRUB entry.
As we can see above System is asking to enter “p” to edit the GRUB to unlock the next set of features.
After enter “p” It will ask for password which we reset now as shown below.
So this is how we can Set/Change the GRUB Paswsord.
If you found this article Useful then Like It, Share It or Subscribe us For Updated Linux Guides and Tutorials. If you have some thing to say then feel free to Comment on the Comment box below.