How To Break Root Password in RHEL 7 – Step By Step

Forgetting password is one of the most irritating things for a system administrator. What happens if you forget the root password in your Red Hat Enterprise Linux 7 (RHEL 7) system. Don’t worry, there is always a solution for a problem. The process of resetting or breaking root password in RHEL 7 is a little bit different from the process we use to reset or break root password in RHEL 6. You have to be extra careful while breaking root password in RHEL 7. In this post, we will explain how to break root password in RHEL 7.

We assume that you have already installed RHEL 7 on your system, if not, visit the following link to install your RHEL 7 system on VMware Workstation or Player as a virtual machine.

To break root password in RHEL 7, you need to perform the following steps:

  1. Reboot your RHEL 7 system.
  2. Type “e” into kernel name on the corresponding starting item when the system startup.Breaking root password in RHEL 7
  3. Find the text linux16, locate and replace “ro” to ”rw init=/sysroot/bin/sh” and then press the ctrl+x keys.Recovering root password in RHEL 7
  4. After making the preceding changes, your kernel script should look like the following.How to reset root password in RHEL 7
  5. Next, execute the following command to mount the root to /sysroot/
#chroot /sysroot/
  1. Next, execute the following command to set a new password for root.
#passwd root

Note: If this command does not work, try the password -d root command to remove the root password and set the desired password later. 

  1. Next, execute the following commands to relabel the file systems and exit from the sysroot.
#touch /.autorelabel
#exit
  1. Finally, execute the following command to reboot your RHEL 7 system.
#reboot
  1. The following figure shows the commands that you need to execute to break root password in RHEL 7.Commands to break root password in RHEL
  2. Now, the system will be rebooted and after a while, you will be able to login with the newly set password.

That’s all you need to break root password in RHEL 7. Please drop your queries if you have something to say.

Posted in Linux Tagged with: ,

Leave a Reply

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

*