CentOS

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.

Recommended Online Training: Learn Bash Shell in Linux for Beginners

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 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

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

GRUB Menu 1
GRUB Menu 2

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

GRUB Menu 3
Edit GRUB Menu 1

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

Edit GRUB Menu 2
GRUB Menu 4

Press b to boot the machine.

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

Restart the machine and login with new password.

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

If you are new to Linux and facing difficulty in working at Linux Bash prompt. We recommend that, you should read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts.

Alaric Bird

Alaric Bird is a seasoned Linux System Administrator with over a decade of experience in managing and optimizing Linux-based servers and infrastructure. Known for his expertise in server deployment, security hardening, and performance tuning, Alaric has a deep understanding of various Linux distributions, including Ubuntu, CentOS, and Red Hat Enterprise Linux. His skills extend to cloud platforms like AWS, where he effectively manages virtual private servers and services. Alaric is also proficient in scripting languages such as Bash and Python, which he uses to automate routine tasks, enhancing efficiency and reliability. With a strong commitment to continuous learning, he stays updated with the latest developments in open-source technologies and best practices. His problem-solving abilities, combined with excellent communication skills, make him a valuable asset to any IT team. In addition to his technical expertise, Alaric is passionate about mentoring junior administrators and fostering a collaborative environment.

Share
Published by
Alaric Bird

Recent Posts

Puppy Linux: Fast and Simple OS

Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…

1 day ago

Change Apache Document Root in Linux

Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…

2 weeks ago

How to Change Apache Port in Linux

Discover how to change Apache port in Linux easily. Follow our simple guide to modify…

2 weeks ago

How to Create Virtual Host in Apache Server

Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…

3 weeks ago

10 Practical Tasks for RHCSA Exam with Solutions

Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…

3 weeks ago

Ultimate Fail2ban Configuration Guide

Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…

4 weeks ago

This website uses cookies.