Howto reset the forgotten root password (Access single user mode) in CentOS/RHEL 6

undefined

How many times did you need to reset the root password for CentOS/RHEL 6? or How many times did you need to login to CentOS/RHEL 6 in a single user mode to perform some fixes for you Linux box?.

For me, I had to login many times, and I expect you’ll need to login in a single user mode many times also.

 

In this mini post I’ll show you how to login in a single user mode to do whatever you need. To do this, do the following steps:

 

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. You will see a GRUB boot prompt telling you to press any key – you have only a few seconds to press a key to stop the automated booting process. (If you miss this prompt you will need to restart the VM again)
  3.  Once the automated booting process stopped, you will see the following screen:undefined
  4. At the GRUB prompt, type “a” to append to the boot command, the following screen will appear:undefined
  5. Add the text “single” or number “1” or letter “s” and press enter.
  6. System will boot and you will see the root prompt. You can do what you want.
  7. Here, I’ll reset the root password, type “passwd” to change the root-password and then reboot again.
Hints:
1. Put into account that some filesystems are mounted in "ro" in the single user mode.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

Leave a Reply

Your email address will not be published. Required fields are marked *