First you need to encrypt your password.

First you need to encrypt your password.
You can do that by running the "md5crypt" command from
within the GRUB shell. Then you need to add a "password" command to grub.conf that uses that
encrypted password, like this:

#touch grub

#grub-md5-crypt >grub Press Enter

Note: - Nothing will be appear on your screen so don't hesitate.
Type The Password such as redhat press enter.
Retype the password redhat press enter.

# vi /root/grub /etc/grub.conf

This command will open both the file in vi editor as shown in the above example.


Password:
Retype password:
$1$I2w2s1$EPZtrLn/h2M4qfh48ZL8O0


Now copy the encrypted passwords using yy.

Then press :
and type n (This will switch you to the next file /etc/grub.conf).

And after the splashimage=(hd,0,0) line : -

press pp to paste the encryped password from the previous file.

and add the following line before the encrypted password like this: -

password --md5 $1$I2w2s1$EPZtrLn/h2M4qfh48ZL8O0


Press :wq

Save and exit and reboot your system.

No comments:

Post a Comment