What if, root or superuser password is lost or forgot in RedHat/CentOS 7 Linux? This is the quick guide or method to reset forgotten root password without any additional recovery tools. But you need to have physical access of the system. I have tested this on RedHat 7 Linux and the same steps can be followed to reset lost or forgotten root password on CentOS 7 Linux as well.
1. Boot your system in GRUB 2 menu
2. Editing GRUB 2 Menu
Press e to edit GRUB 2 menu, you can see the similar screen as below. Scroll down and search linux16 or linuxefi (if your system is efi enable) and move to the end of the line. Add the string init=/bin/bash to the end of line after giving space. Also remove the rhgb quiet from that line.
3. CTRL+x to boot in single user mode.
4. Run load_policy to load the installed policy file into the kernel.
5. Use mount command to remount the root filesystem in read-write mode
6. Change root password
7. Run the exec /sbin/init command
System boots up, you can try login with newly recovered or reset root password (if root user is enabled).