I know to recover the root password with RHEL 7 and 8, and CentOS 7 and 8, but when I attempt to remount or chroot to /sysroot that does not seem to work on Rocky Linux 8.
Can someone provide the official instructions for recovering the root password for this brand?
Now reboot, and you should be able to login with the new root password. The command in point 7 is required for selinux, else it won’t work. This will then relabel all files that would have had their selinux permissions reset after the commands we just ran. If selinux is disabled on your system this probably can be omitted, but recommend running it anway.
Thanks, I had tried these steps, so I am guessing that when I renamed one of the libraries (for a video I was going to make and share) I must have broken the OS.
It asked me for the password when I selected normal, versioned kernels in grub. When I select the kernel option with “rescue” in the name, the steps above worked for me.
Hey mate, I created an account on this forum just to say THANK YOU!!
I was tearing my hair out trying to figure out why I wasn’t able to log into the root account after resetting it, and this method worked a charm! I was trying all the other methods for CentOS and nothing was working, but this was the golden forum post that saved me.
Hi. Thanks. It worked for me but now I can login only as root. Every time I see “Give root password for maintenance” than login as root but when I try sudo --user=me /bin/bash and startx I see “Permission denied” to console (Xf…). How can I return normal login procedure?