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