How to recover Root Password in CentOS 6

Share on Social Media

In this article, you will learn, how to recover Root Password in CentOS 6 or other Red hat based Linux OS. #centlinux #linux #recovery

Problem Statement

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 recover root password in CentOS 6 Server.

If you’re serious about building a career in IT, the Complete Linux Training Course to Get Your Dream IT Job 2025 by Imran Afzal is one of the best investments you can make in yourself. This highly rated course takes you from the basics of Linux to advanced system administration skills, preparing you for real-world IT roles and certifications.

Whether you’re a beginner or brushing up your skills, the structured lessons, hands-on labs, and career-oriented approach make it a perfect choice to boost your confidence and job readiness. Enroll now and start your Linux journey today!

Disclaimer: This post contains affiliate links. If you purchase through these links, I may earn a small commission at no additional cost to you. This helps support the site and allows me to continue creating valuable content.

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.

CentOS 6 Startup
CentOS 6 Startup
CentOS 6 Login
CentOS 6 Login

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 Reboot
CentOS 6 Reboot

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

GRUB Menu 1
GRUB Menu 1
GRUB Menu 2
GRUB Menu 2

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

GRUB Menu 3
GRUB Menu 3
Edit GRUB Menu 1
Edit GRUB Menu 1

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

Edit GRUB Menu 2
Edit GRUB Menu 2
GRUB Menu 4
GRUB Menu 4

Press b to boot the machine.

Linux Single User Mode
Linux Single User Mode

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

Use the passwd command to reset the password of root.

recover Root Password in CentOS 6
recover Root Password in CentOS 6

Restart the machine and login with new password.

Reboot CentOS 6
Reboot CentOS 6
CentOS 6 Login as root
CentOS 6 Login as root

root password of your CentOS / RHEL 6 machine has been recovered.

Read Also: How to reset Root Password in CentOS 7

Leave a Reply