First, reboot or power on your CentOS 8 system. Next, press ‘e’
on the keyboard to interrupt the boot process to make changes.

Find ro
(read-only) kernel parameter as showed below.

Replace ro
with rw
and append an extra init=/sysroot/bin/sh
.

After making the changes, press Ctrl + X
on the keyboard to enter single-user mode.
Now mount the root file system in read and write mode.
:/# chroot /sysroot

Now set your root password as you like:
:/# passwd root

Now, run the below command to enable SELinux relabelling.
:/# touch /.autorelabel

To apply the changes, exit and reboot the CentOS 8 system.
:/# exit :/# reboot

Reboot can take some times. After reboot your centos 8 system login with your new root password.
Was this helpful?
2 / 0
Thanks, it worked!
Hello. remarkable job. I did not expect this. This is a remarkable story. Thanks!