Boot Single User Mode – Resetting forgotten root user account password in RHEL/CentOS 6

While booting hit an arrow key, and it will take you to the GRUB menu. Again, use an arrow key to select the entry that you want to modify.
And hit “e” key to edit this. Find line which starts with “kernel“, and almost at the end of this line find “rhgb quiet“, and add “1” after “quiet“, so it will look like this: “rhgb quiet 1“. Once this is done hit enter. Now, it will take you to the kernel setting prompt. Just press “b” to boot from the kernel, and it takes you to the single user mode.

Now, you are in a single user mode, and you will be able to reset a root password, but before you do that check whether the SELinux is enabled or disabled.
Just type: “getenforce“. It has three contents: Enforcing – no permission to reset a root password. Permissive – permission to rest a root password, and Disabled – No policies are loaded. If you have Enforcing enabled you can disable it by using the following command: “setenforce 0“.
Once this is done, you can change a root password 🙂

Leave a Reply

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