In this article, you will learn, how to recover Root Password in CentOS 6 or other Red hat based Linux OS. #centlinux #linux #recovery
Table of Contents
As we know that, the root is the superuser in every Linux distros. We often come to situations, where, the root password is not available. Although it is trivial to reset root password, if you have a user with sudo rights. otherwise it becomes a little tricky. To reset the password of root user we required physical access to the machine or in case of virtual machines we need console access via respective VM Manager.
In this post, we will reset the root password of a RHEL 6 Server.
Read Also: Create OpenLDAP Address Book in CentOS 7
Recover Root Password in CentOS 6:
Start your RHEL 6 machine and try to login with root user.
We could’t login to our RHEL 6 machine, because we didn’t know the root password.
Login with another user and restart the machine.
At GRUB boot menu, press e to edit the menu entry.
Go the line that contains kernel command and press e to edit it.
Append 1 at the end of this command and press <ENTER> to save changes.
Press b to boot the machine.
The system now boots into Single User mode, without asking for any password.
Use the passwd command to reset the password of root.
Restart the machine and login with new password.
root password of your CentOS / RHEL 6 machine has been recovered.