Saturday, July 20, 2013

Breaking root Password in RHEL6

Some time you may need to recover your root password if you forget this, it is very simple to break root
password in linux. use the following steps to break root password.

Breaking root password:
1- reboot your system.
2- When system ask to select OS press any key to interrupt default OS selection.
3- press ‘e’ to edit kernel parameter before booting.
4- Choose the second option ‘Kernel/vmlinuz-2.6.i8, again press ‘e’.
5- Type ‘1’ at the lend of the line to go in single user mode.
6- Then press ESC key to return back and then press ‘b’ to boot system.
7- Now system will reboot and start with single user mode prompt.
8- Here type sh3.2# passwd -d root  then press enter this will remove password for root user.
10-Now reboot your system and you will be able to login without password where you can change password for root.
But people says that linux is highly secure but how when anyone can break password as so easy.
Oh dear linux is really secure but you need to do some security configuration. In next section we will learn how to protect grub from being modify. Now if you will try to break root password you need to know grub password.

Grub Security (set password on grub after installation):
1-Open terminal and type following command to generate md5 encrypted password
# grub-md5-crypt
Password:
Confirm password:
(Here you will see encrypted code, copy this carefully no any extra character like as space).
2-Now edit grub.conf file with any editor.
# vim /boot/grub/grub.conf
Here you will see a lot of option go to under "hiddenmenu" and type following syntax
Password --md5 paste encrypted password that you have copied
3-Save this file.
4-Reboot your system and try to modify grub to break root password, it will prompt for grub password.
Now your root password is protected.

No comments:

Post a Comment