Skip to main content


RHEL8 root password recovery

When studying to apply for a Redhat certification I tend to go over root password recovery again. Just in case ๐Ÿ˜„

A normal installation of RHEL8 will display the grub menu when booting. When the menu appears on screen press e:


Go to the end of the linux line (which is longer than one row) and add rd.break at the end of the line:


Press Ctrl+x to boot and wait for the prompt.


Now you have to mount (rw mode) the sysroot partition, chroot to it and change the root password:


If SELinux is enforcing, this is mandatory

Before rebooting, a file /.autorelabel must be created in the root directory to instruct SELinux to relabel filesystem upon next boot. Then, type exit twice:


The boot process will take longer than usual because of relabeling, but you will be able to login with your new root password.

comments powered by Disqus