How To Reset Lost root Password in CentOS 8 / RHEL 8
Abstract: Administrators sometimes end up with a requirement to reset the root password due to a lost root password. It’s quite often happening because administ
Administrators sometimes end up with a requirement to reset the root password due to a lost root password. It’s quite often happening because administrators have to remember lots of passwords or frequent change of root password to adhere to organizations password policies.
In this guide, we will see how to reset the root password in CentOS 8 / RHEL 8.
PrerequisitesBoot the system into the single-user mode using the below link.
READ: How To Boot into the single-user mode in CentOS 8 / RHEL 8
Reset lost root passwordchroot your system if you haven’t done already.
chroot /sysroot
Reset the root password.
passwd
Update SELinux information.
touch /.autorelabel
Exit chroot.
exit
Reboot your system.
rebootReset Lost root Password
Please wait for SELinux relabeling to complete. This relabeling would take some time depending on file system size.
SELinux RelabelingYou can now login to your system with the new password.
Login ConclusionThat’s All. I hope you have learned how to reset the lost root password in CentOS 8 / RHEL 8.