Resetting root password - bypass GRUB password protection

When booting into single user mode, you may be required to enter the root password - not that useful if you don't know it.

Procedure to reset the root password

Start the system and on the GRUB 2 boot screen, press the e key for edit.
Remove the rhgb and quiet parameters from the end.

Add the following parameter at the end of the linux16 line, or linuxefi on UEFI systems:

init=/bin/sh

The Linux kernel will run the /bin/sh shell rather than the system init daemon. Therefore, some functions may be limited or missing.

Press Ctrl+x to boot the system with the parameter.

The shell prompt appears.

The file system is mounted read-only. You will not be allowed to change the password if the file system is not writable.

Remount the file system as writable:

~]# mount -o remount, rw /

You could also try to mount all files in your fstab file

~]# mount -a

Normally, you would just change the password (using passwd) but in some cases, the binary may be on a partition that was not mounted (I found that /user/bin wasn't mounted).

I worked around this by adding a user with root privileges, with no password configured

To add a user to /etc/passwr:
echo "newuser::0:0::/:/bin/bash" >> /etc/passwd

Finally....

Reboot.

You may receive a message that selinux needs to re-apply it's policy to files.