How to create and remove GRUB password

How to create and remove GRUB password

how-to-create-grub-password

Create grub password:-

If we didn’t use grub password any can boot our OS into single user mode and can access with full privilege so to avoid that we should use grub password  to protect our single user mode.

we can create grub password in two methods.
1.while installing OS.
2.after installing OS.

The following steps gives you clear idea of creating grub password after installing OS.

1.Single OS Configuration
2.Dual OS Configuration

Single OS Configuration:-

# grub-md5-crypt
Password:<ENTER-YOUR-PASSWORD>
Retype password:<ENTER-YOUR-PASSWORD>
$1$gK7s81$vJ1SRvLTZn1z2/cdARggd0

copy the encrypted password and past in /boot/grub/menu.lst  i.e. link file /boot/grub/grub.conf

# vim /boot/grub/menu.lst
add this line
password –md5   $1$gK7s81$vJ1SRvLTZn1z2/cdARggd0

:wq

then reboot your system
Press any key to interrupt & enter grub menu

Then press ” p ”

Then enter your grub password.

DUAL BOOT – Configuration

If Dual boot is enabled in grub then we should change little bit in configuration file.Because the other os is unsecure.
Look for the title line of the non-secure operating system and add a line that says lock.

vim /boot/grub/menu.lst
title Red Hat               ————-> After this line add following lines.
lock
password –md5   $1$gK7s81$vJ1SRvLTZn1z2/cdARggd0
:wq

Enjoy the secure grub…. :-)

Remove grub password:-

# vim /boot/grub/menu.lst
remove the following line

password –md5   $1$gK7s81$vJ1SRvLTZn1z2/cdARggd0

:wq

then reboot your system. Press any key to interrupt enter grub menu and go to single user mode it won’t ask password.

 

==========================> Blass <============================




Leave a Reply

Your email address will not be published. Required fields are marked *