In this article we will show you how to reset the forgotten root password on RHEL, CentOS, and Fedora.
To reset the root password we will boot the Linux system in single user mode.
Boot your CentOS Linux system and press ESC key when you see the message “Press any key to enter the menu”
Type ‘a‘ to modify kernel argument. Anytime you can cancel by entering ‘ESC‘ key.
In Kernel configuration type1 at the end of “rhgb quiet” and press “Enter” key to boot into single user mode.
After reboot type ‘passwd‘ command without username and press ‘Enter‘ key in command prompt.
It’ll ask to provide new root password and re-type the same password for confirmation.
Reboot your system and login using the new password.
“You are Done” Congratulation!!!