
To reset the root password on a Red Hat system when you've forgotten it, you typically use the GRUB bootloader to enter emergency mode. However, the screenshot you shared shows that after using rd.break, you are dropped into an emergency shell, but the root filesystem is mounted as read-only. Here’s how you can proceed to reset the root password:
e to edit the boot parameters.Find the line starting with linux16 or linuxefi.
At the end of this line, add the following:
textrd.break init=/bin/bash
This will break the boot process before the root filesystem is mounted and drop you into a shell with a writable /sysroot.
Press Ctrl+X or Ctrl+Enter to boot with these changes.
/sysroot as Read-Writebashmount -o remount,rw /sysroot
/sysrootbashchroot /sysroot
passwd command to reset the root password:
bashpasswd root
bashtouch /.autorelabel
bashexit exit
rd.break method alone does not automatically remount /sysroot as read-write, which is why you cannot edit files directly.init=/bin/bash parameter ensures you get a shell with the ability to remount /sysroot as read-write./sysrootmount -o remount,rw /sysrootchroot /sysrootpasswd roottouch /.autorelabelLe Chat can make mistakes. Check answers. Learn more