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 rootNow type command.
new password = ********* /* set your new password */
repeat password = ********
rebootBy 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 =>
$ grubNow write this command in terminal =>
encrypt: $1$lS2dv/$JOcHkLosIn7CJk9xShzzJVw /* remember this value */
$ vi /boot/grub/grub.confYou can see a large file and find this line.
gfxmenu (hd0,4)/messageif 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.
color white/blue black/light-gray
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.