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:
chroot /sysroot
- Eventually, to reset the password, we run:
passwd root
- Then we update SELinux information:
touch /.autorelabel
- And then we exit chroot
exit
- Finally, we go ahead and reboot the system
reboot
[Stuck in between? We are here to help you out]
Conclusion
In short, we saw the steps our Support Techs employ to fix the CentOS 7 password query.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments