RHEL8 change root password now it hangs at boot

Latest response

Hi all

I am studying the RHCSA and practicing changing root password.

I got an RHEL8 VM on vmware workstation on win10.

So I reboot my vm, insert rd.break into grub, mounts the sysroot, chroot into sysroot, and passwd the new root password, and it all seems to be going fine. I got the successful password token updated message.

then I exit out the shell and reboot on the cmd line, and the VM seems to hang at the screenshot I have attached.

It is a brand new VM, I haven't done anything special to it, everything is the factory default. no selinux. and when I try to ssh into it with my user id (not the root one) it always says my password is wrong (though I think this might be more because my vm isn't fully started yet).

change root pwd and vm hangs

Even a reboot of the vm (from vmware) doesn't work, it just hangs at a different place.

change root pwd and now vm hangs 2

I don't understand why this is happening.


selinux is enabled by default when you install rhel7/8 . there isnt any option i could find that allows you to disable this. that being said, i tried to reproduce this on rhel8 but couldnt. my system came back up normally but the new root password did not take effect (because selinux is on by default). since this is a new vm, i would retry the break-in process again to see if it works, if not just reinstall the vm.

Hi, you are using Red Hat 7/8 then you can use the rd.break with space enforcing=0 for disable Linux security. after break password you can use restorecon -v /etc/shadow and then you can run stenforce 1 . I hope after that your system are not hanged.

you can also remove 'rhgb quiet' for a more verbose output on the screen

You need to perform:

touch /.autorelabel

after the password change, then restart the VM

Would be nice to know if the RHEL7 procedure works on RHEL8.

Changing and Resetting the Root Password in Red Hat Enterprise Linux 7 System Administrator's Guide.

Yes, it works on RHEL 8.

thank you

Another link (not RH) with what looks like a clear procedure to reset a lost root pass on rhel8

To the original poster Junzhe Zou, please re-read what ir. Jan Gerrit Kootstra wrote above.