How to set password in GRUB and make it more secure.
Now a days in every IT Company security is the main & serious issue.
Use the following steps to set Password in grub, so that only authenticated users have full access of it.
Steps :
Use the following steps to set Password in grub, so that only authenticated users have full access of it.
Steps :
- Make a MD5 encrypted password hash by "grub-md5-crypt" command, Make a note of password hash.
- Now edit GRUB configuration file "/boot/grub/grub.conf" with any text editor, and add a line in to it as below;
- Save file & Reboot your system to check.
- Next, when system reboots go to grub by interrupting boot process (Keep Pressing any key after bios loads), Now once you see grub screen press "P" as instructed there on the GRUB screen, it'll ask you for password.
- Now after entering password, it'll go to unlocked grub screen.
To remove this password, again edit /boot/grub/grub.conf & remove "password --md5 <MD5 Hash>" .
-Enjoy ;)
Interesting tips i am read all article this information is very useful me thanks for nice sharing keep it up........
ReplyDeletedisk crash recovery
how to remove that password.. if i forget the grub and root password.
ReplyDeletePlease check below workaround.
DeleteIt's simple ... follow below steps:
ReplyDelete1. Boot from your OS bootable 1st CD/DVD.
2. Go into "Rescue Mode", in DVD boot prompt "boot: linux rescue".
3. chroot DVD system image,
#chroot /mnt/sysimage
4. Edit /boot/grub/grub.conf and remove "password --md5 " line. This will remove grub password once you reboot OS.
At the same time when you are in rescue mode change root password using "passwd" command on root "#" prompt.