RHEL Recover root Password: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
## <tt>'''# exit'''</tt> | ## <tt>'''# exit'''</tt> | ||
== RHEL8 == | == RHEL8/RHEL9 == | ||
# Reboot OS into emergency mode. | # Reboot OS into emergency mode. | ||
# During the GRUB2 countdown, Edit the first line by pressing <tt>'''"e"'''</tt>. | # During the GRUB2 countdown, Edit the first line by pressing <tt>'''"e"'''</tt>. |
Revision as of 13:48, 19 September 2023
RHEL7
- Reboot OS into emergency mode.
- During the GRUB2 countdown, Edit the first line by pressing "e".
- Locate the line that reads "linux16".
- Immediately following the "quiet" keyword append "rd.break"
- Locate the line that reads "linux16".
- Continue the boot process.
- Press Ctrl-x to boot.
- The system will boot into emergency mode and the switch_root prompt will appear.
- Remount the /sysroot filesystem as rw.
- # mount -o remount,rw /sysroot
- chroot to the /sysroot filesystem.
- # chroot /sysroot
- Create a new password.
- # passwd
- Update the SELinux Security Context.
- touch /.autorelabel
- Exit the /sysroot chroot.
- # exit
- Exit emergency mode.
- # exit
RHEL8/RHEL9
- Reboot OS into emergency mode.
- During the GRUB2 countdown, Edit the first line by pressing "e".
- Locate the line that reads "linux".
- Immediately following the "quiet" keyword append "rd.break"
- Locate the line that reads "linux".
- Continue the boot process.
- Press Ctrl-x to boot.
- The system will boot into emergency mode and the switch_root prompt will appear.
- Remount the /sysroot filesystem as rw.
- # mount -o remount,rw /sysroot
- chroot to the /sysroot filesystem.
- # chroot /sysroot
- Create a new password.
- # passwd
- Update the SELinux Security Context.
- touch /.autorelabel
- Exit the /sysroot chroot.
- # exit
- Exit emergency mode.
- # exit