Wednesday, May 13, 2009

Forgotten root Password of RHEL,Fedora Core and CentOS.

If you want to reset or forgot root password.You will have to boot your linux in single user mode.If you are using Grub boot loader follow below steps.

Step 1:- At the boot loader menu, Press arrow keys to highlight the installation you want to edit and type A to enter into append mode.

Step2:- You are presented with a prompt that looks similar to the following:

grub append> ro root=LABEL=/

Step 3:- Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:

ro root=LABEL=/ single
or

ro root=LABEL=/ 1

Step 4:- Press [Enter] and Press b GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:

sh-2.05b#

Step5:- You can now change the root password by typing

passwd root

It will be asked to re-type the password. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt. Then you can log in to root as you normally would.
Enjoy!

No comments:

Post a Comment