How to Reset Forgotten Root Password in RHEL/CentOS and Fedora

In this post will guide you simple steps to reset forgotten root password in RHEL, CentOS and Fedora Linux with example. There are various ways to reset root password which are.

  1. Booting into single user mode.
  2. Using boot disk and edit passwd file.
  3. Mount drive to another system and change passwd file.
Reset Root Password

Reset Forgotten Root Password

Here, in this article we are going to review “Booting into single user mode” option to reset forgotten root password.

Cautious: We urge to take backup of your data and try it out at your own risk.

STEP 1. Boot Computer and Interrupt while booting at GRUB stage hitting ‘arrow‘ keys or “space bar“.

Booting Grub Stage

Booting GRUB Stage

STEP 2. Type ‘a‘ to modify kernel argument. Anytime you can cancel typing ‘ESC‘ key.

Modifying Kernel Parameters

Modify Kernel Argument

STEP 3. Append 1 at the end of “rhgb quiet” and press “Enter” key to boot into single user mode.

Append 1 at the GRUB

Append 1 at the Screen

STEP 4. Type command “runlevel” to know the the runlevel where you are standing. Here “1 S” state that your are in a single user mode.

Command runlevel

Type Command runlevel

STEP 5. Type ‘passwd‘ command without username and press ‘Enter‘ key in command prompt. It’ll ask to supply new root password and re-type the same password for confirmation. “Your are Done” Congratulation!!!

Passwd Command

Type passwd Command

What if GRUB bootloader is password protected? We’ll cover in our next article, how to protect GRUB with password and reset the same. Stay tuned…

If you find this article is helpful, or you may have some comments or query about it please feel free to contact with us through below comment box.

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

63 Responses

  1. Rahul says:

    Hi All, I am new to Linux. I tried to break my root password with above method. but when i interupt the grub, and type a, nothing comes up. After sometime it just loads the default OS version, but when i give e instead of a, and use different sets of commands, I am able to change the root password. Can some one tell what am i missing in the above method. I am using centos 7 in my VM.

  2. Paul says:

    Same here as @ravi. It’s giving me “give the root password for maintenance.“. Version 2.6.32-358.0.1.el6.i686

  3. ravi says:

    It is giving the massage that give the root password for maintenance.

    i am not able to attach the screenshot

    • Ravi Saive says:

      @Ravi,

      Which version of Linux distribution are you using? mostly it wouldn’t ask for password in maintenance mode, either you doing wrong, follow the instructions carefully..

Leave a Reply to Rahul Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.