Set password on Linux grub to secure root user | Redhat 6

When we are installing linux based operation system we set root password. But anyone can break this password using single user mood. Specially in Redhat. To increase security we can set password on Grub. First i will teach you how to break password using single user mood. Then you can know how to set password on Grub that anyone can not break password using single user mood.

Turn on your PC, you can see grub. Select Redhat 6, Don’t click it. Then press “e”. You will get a black screen. Press Space. Then write “single”. Press Enter and write “b”. Now your single mood is on. Now write
passwd root
new password = ********* /* set your new password */
repeat password = ********
Now type command.
By this method anyone can break password of the root user. As to break security we have to use grab, for this reason we set password on the grab.
Turn on your Linux OS. open the terminal and write =>
$ grub
grub> md5crypt
password: mashpy
encrypt: $1$lS2dv/$JOcHkLosIn7CJk9xShzzJVw /* remember this value */
grub> quit
Now write this command in terminal =>
$ vi /boot/grub/grub.conf
You can see a large file and find this line.
gfxmenu (hd0,4)/message
color white/blue black/light-gray
default 0
timeout 8
if you have found this line, please add this code. You can see we have put the md5 code what we have found 1 minute ago.
password –md5 $1$lS2dv/$JOcHkLosIn7CJk9xShzzJVw/
Press Esc , then colon : , then wq , then Enter.
Now successfully you have set password on the grub. To test you can restart your pc and when you are on the grab, select linux based os name and press “e”. You can see it will not work. To enter the password protected grab you must write “p” and then input the password and then Login.
By this method you can secure your root user.


Popular Posts

Install and configure Network simulator (ns3) on Ubuntu 14.04