In our last article we known about how to reset the root password but its security vulnerable to Linux.Anyone who have physical access to system can easily reset the root password. So we can avoid it by using the setting up of the grub password.
To set the grub password we set superusername and password in grub configuration file.
For this we have to modify the grub2.conf file in /etc/ directory
firstly we have to create a password by using grub2-mkpasswd-pbkdf2 command copy the password and enter password twice as follows
[root@localhost Desktop]# grub2-mkpasswd-pbkdf2
Enter password:
Reenter password:
PBKDF2 hash of your password is
grub.pbkdf2.sha512.10000.0CF75C9C2D55B12B49DB7095BEA3F75CEB0127806F7AEBB1955FE981A04C17FD40B23CEAD3895352549F9182E86D70A6640A353325870518BD6D063C212171B5.0C193E166A38FBEBE5AD29E52484C0BAD38F194E1CEC1B7B00AB3B6CA0991B080AC08D9A8D0065C75EA9B7653772A537A03F51032D6CCE5B9779F88BD26DA956
[root@localhost Desktop]#
Then open /etc/grub2.conf file and locate ### BEGIN /etc/grub.d/10_linux ###
section type the code as follows here I used the username is root that is our choice
set superusers “root”
export superusers
password_ pbkdf2 root
grub.pbkdf2.sha512.10000.0CF75C9C2D55B12B49DB7095BEA3F75CEB0127806F7AEBB1955FE981A04C17FD40B23CEAD3895352549F9182E86D70A6640A353325870518BD6D063C212171B5.0C193E166A38FBEBE5AD29E52484C0BAD38F194E1CEC1B7B00AB3B6CA0991B080AC08D9A8D0065C75EA9B7653772A537A03F51032D6CCE5B9779F88BD26DA956
That’s It, Now You can reboot and Press “e” on Grub Menu, It will ask you for the password