Followers

Tuesday, December 4, 2012

Resetting root password in a RH linux version 6.0

We have installed the latest version Redhat.Enterprise.Linux.v6.UPDATE.2.X86_64 on one of our servers. Probably the grub prompt time setting is set to 0, so we never see a grub prompt when the computer booted. Numerous posts indicate that one has to set the run level to 1 during boot time to set the kernel settings to single user mode, then just type a password. Howver, in our machine, we could not get that prompt at all.

Yesterday, one of my students, Dhritiman Jana was in the lab and he spent around few hours of his time in solving the issue. Following are his note on how to get to the grub prompt:

Once you get to the command prompt, say startx. From there, you could start and reboot the system

Once the computer starts rebooting press any key constantly. When I say constantly, it should be literally constantly without a pause. At the same time, just time your tapping so that you tap once in 2 seconds or so. Then you will enter grub prompt. Press enter there, then you will enter kernel mode (There will be a list of items and the one that says kernel). Put the cursor on it and press 'e', then the screen will go back to another page, where you will see a string 'rhgb' at the prompt, put a space followed by 1 and then press enter. It may so happen that you  may not see the 'rhgb' string here, in that case, just use your arrow key to get the 'rhgb' line. Once this part is taken care of, this will again take you back to kernel mode. There, this time press 'b' . Then the computer is now ready to boot in single user mode and that is root. Once the computer boots you are already logged as root. So, you can do as you please as root, and one of the things you would like to do is change the password. type passwd command and change the password to a suitable one. 

Hope this solution works for all!

4 comments:

  1. Thank you madam for putting it in a good shape.

    ReplyDelete
  2. @Dhritiman : thank u dhritiman! we successfully changed the password once again. your blog is really useful . :)

    ReplyDelete
  3. I have also figured out that the passwd -x option of the server needed to be changed for the root, so that the root password does not expire as it does now. So, I have set it to -1, so that it never expires...

    ReplyDelete