Note - If Grub password is set and you forget even that , no body can help you !
Here are the steps to reset it.
I will be using my RHEL system as an example.
STEP 1
Reboot your system , before it boots into the default kernel , press e to enter the GRUB menu
STEP 2
Again press e ( edit ) to see the location of the initrd image using the arrow keys select the kernel vmlinux option ( 2nd option in the screen shot below )
STEP 3
Press e gain and type s next to quite , press
STEP 4
Now the sytem boots to single user mode , just type passwd and set your password and restart your system ( you can type init 6 here)
Now you can login with your new password .ENJOY !!!
Thanks,
vedaprasad
this is useful info... but any user can just restart the system and change the root passwd with this approach right??..
ReplyDeleteYes,that is why need to set GRUB password as well .
ReplyDeleteSo when you have to get into the GRUB menu itself, does it ask for the GRUB password?.. I am new to Linux systems and hence the novice questions...
ReplyDeleteIf grub password is not set then it won't ask for any password , to get into GRUB Menu.
ReplyDeleteto set grub password -
type "grub-md5-crypt" as root
an encrypted password will be generated , copy that and put it in /boot/grub/grub.conf as
password -md5 "generated encrypted password".