RHEL Recover root Password: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 43: | Line 43: | ||
== Further Reading == | == Further Reading == | ||
# [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-working_with_the_grub_2_boot_loader#sec-Changing_and_Resetting_the_Root_Password RHEL7 Changing root | # [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-working_with_the_grub_2_boot_loader#sec-Changing_and_Resetting_the_Root_Password RHEL7 Changing and resetting the root password] | ||
# [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings#resetting-the-forgotten-root-password-on-boot_changing-and-resetting-the-root-password-from-the-command-line RHEL8 Changing root | # [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings#resetting-the-forgotten-root-password-on-boot_changing-and-resetting-the-root-password-from-the-command-line RHEL8 Changing and resetting the root password] | ||
# [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings RHEL9 Changing root | # [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/changing-and-resetting-the-root-password-from-the-command-line_configuring-basic-system-settings RHEL9 Changing and resetting the root password] | ||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 13:56, 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