Single User Mode
This method should also work on EL7 and EL8.
If you are unable to log-in to your system and have physical access, you can use single user mode to boot into it and do things like:
- Reset forgotten root password
- Fix configuration and other boot issues
- Repair filesystem if it is corrupted
Reboot your machine and at grub menu choose a kernel and hit “e” to enter edit mode
Append “rd.break” (w/o quotes) at the end of line that says “… /vmlinuz-3.x.. root=…”
Hit Ctrl-x to boot into this kernel as single user
Now remount the /sysroot in ‘rw’ mode as follows:
mount -o remount,rw /sysroot
chroot /sysroot Fix the issue or use “passwd” to change password.
Finish the process (and reboot) by executing
touch /.autorelabel
reboot -f 