Friday, 12 February 2021

Another way to recover RHEL 8 / CentOS 8 root password

Boot to the GRUB menu and enter the edit mode. Use your arrows to navigate to the the menu item you would normally boot your RHEL 8 Linux system from. Press e to start editing the selected menu item.

Perform a break at an early stage of the boot process by typing rd.break at the end of the line starting with Linux. Add systemd.debug-shell after rd.break

Once ready press CTRL+X to start the RHEL 8 boot process

 To access the debug shell on TTY9. Press CTRL+ALT+F9 (Do not hit any other button!)

On TTY9: 

mount -o remount,rw /

passwd root

touch ./autorelabel

exit

Press CTRL+ALT+F1

Press ENTER

Login with root and the new password.