Author Photo

Ahmer's SysAdmin Recipes is a blog for Linux System Administrators. This blog provides recipes for Installation & Configuration of Linux, Ubuntu, Oracle Database, MySQL, Apache, Nginx, Oracle Cloud Control, FreeIPA, Kerberos & OpenLDAP, Subversion, PXE, DevOps, etc. over Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu and Windows.

Please give me your feedback and help me improve this blog. Please let me know If you want me to write on a specific topic.

Saturday, 4 March 2017

Recover Root Password in RHEL 6

Recover Root Password in RHEL 6As 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.

 

Password Recovery

Start your RHEL 6 machine and try to login with root user.

CentOS 6 StartupCentOS 6 CLI Login Prompt

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.

CentOS 6 CLI Reboot

At GRUB boot menu, press e to edit the menu entry.

CentOS 6 GRUB MenuCentOS 6 Edit GRUB Menu

Go the line that contains kernel command and press e to edit it.

CentOS 6 GRUB Edit Kernel CommandCentOS 6 GRUB Edit Kernel Command (Current)

Append 1 at the end of this command and press <ENTER> to save changes.

CentOS 6 GRUB Edit Kernel Command (New)CentOS 6 GRUB Menu (New)

Press b to boot the machine.

CentOS 6 Single User CLI

The system now boots into Single User mode, without asking for any password.

Use the passwd command to reset the password of root.

CentOS 6 Single User CLI (passwd)

Restart the machine and login with new password.

CentOS 6 Single User CLI (reboot)CentOS 6 CLI (root user)

root password of your RHEL 6 machine has been recovered.

Read Also: Reset Root Password in RHEL 7

Recover Root Password in RHEL 6


YOU MIGHT ALSO LIKE:

No comments:

Post a Comment