Howto reset the forgotten root password (Access single user mode) in CentOS/RHEL 6
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:
- 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.
- 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)
- Once the automated booting process stopped, you will see the following screen:
- At the GRUB prompt, type “a” to append to the boot command, the following screen will appear:
- Add the text “single” or number “1” or letter “s” and press enter.
- System will boot and you will see the root prompt. You can do what you want.
- 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:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.