Grub & Single user mode password Protected
Hi Friends,
I am writing method that how to set up password for Grub & single user mode.
This Method will apply on RHEL 5 & Fedora 8/9/10
Open Terminal
Then login as a root. i.e.
[itsolutions@ask4itsolutions.com]$su – root
password :- ******
[root@ask4itsolutions.com ~]# grub-md5-crypt then press enter
That will ask you password
Password:- ******
Retype Password:- ******
$1$8fo8r$OZb9wjN2SsueIePblEzmt. (You will find this type of hash value)
First Backup your grub.conf because if any trouble then you can recover it. Backup your grub file by this way.
cp /boot/grub/grub.conf /boot/grub/grub.conf.bkp
To Make Grub Password Protected Copy that HASH value which was generated by grub-md5-crypt and paste it exact after title line look at below example.
vim /boot/grub/grub.conf
default=0
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.27.9-159.fc10.i686)
password – -md5 $1$8fo8r$OZb9wjN2SsueIePblEzmt. (This Entry will Protect Grub with Password)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.9-159.fc10.i686 ro root=UUID=063976ce-f9ca-4ced-bb6f-e32290b0faf9 rhgb quiet vga=792
initrd /boot/initrd-2.6.27.9-159.fc10.i686.img
To Make Single User Mode Password Protected Copy that HASH value which was generated by grub-md5-crypt and paste it exact after splashimage line look at below example.
vim /boot/grub/grub.conf
default=0
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
password - -md5 $1$8fo8r$OZb9wjN2SsueIePblEzmt. (This Entry will Protect Single user mode with Password)
hiddenmenu
title Fedora (2.6.27.9-159.fc10.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.9-159.fc10.i686 ro root=UUID=063976ce-f9ca-4ced-bb6f-e32290b0faf9 rhgb quiet vga=792
initrd /boot/initrd-2.6.27.9-159.fc10.i686.img
Enjoy
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.








thanks ya……..
its helpng……..
Hi,
On RHEL5 the Password hashkey gets displayed if I place it under TITLE , which is not a good thing.
And for enforcing authentication for grub and for single user mode , I had to place the hash key under title as well as under splash.
Is there any other methodology, could you please check one.
Regard,
Mohiddin
[...] Click on Below link to Continue Reading at Ask4 IT Solutions ( IT Solutions Provider India) Click on this link to continue reading :- http://blog.ask4itsolutions.com/2009/01/01/setting-up-password-for-grub-single-user-mode/ [...]
Hi Tejas,
This post is awesome.Setting grub password manually from your instruction its great because its nice instructions.
Its work like charm.its great instruction
Thanks for this nice step by step instruction.