The method to Recover Root Password in Centos 7 is totally different from Centos 6.
As part of our Server Management Services, we assist our customers with several CentOS queries.
Today, let us see how we can reset the root password in CentOS 7.
How to Recover Root Password in CentOS 7
Recently, we had a customer who came across issues while booting the server.
After a thorough check in the server via IKVM, we could see that the booting process was interrupted.
In addition, the prompt was asking for the root password to boot into the maintenance mode.
Since the customer couldn’t remember his root password, our Support Engineers reset the root password.
Moving ahead, let us see the steps our Support Techs employed to perform the same.
- Initially, in the boot grub menu, we select the option to edit.
- In the end, we can see a message stating, “Press ‘e‘ to edit the selected item”.
- Then we go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh.
- Now we press Control+x to start on single-user mode.
- After that, we access the system using the following command:
- Eventually, to reset the password, we run:
- Then we update SELinux information:
- And then we exit chroot
- Finally, we go ahead and reboot the system
[Stuck in between? We are here to help you out]
In short, we saw the steps our Support Techs employ to fix the CentOS 7 password query.