Reset root password in RHEL 8.5

0 Comments

root password can be changed by command sudo passwd root ,and system will ask you about the old password .in case you lost the root password pls follow the next steps to recover the root password

1- Boot Red Hat system

2- Interrupt Boot process  and press “e”

3- Kernel boot parameters will be displayed , change the option under linux line ,delete “ro crash“, then add “rd.break enforcing=0”  then press <Ctrl-x> to start system

4-You’ll boot to a ‘rescue’ prompt

switch_root:/#.

5- Remount the root partition in read-write mode so that you can run commands

6- Switch to /sysroot directory

7-RESET root password

8- enable SELinux relabeling on reboot and exit the console.

Tags: ,