How to Reset the Root Password in RHEL 9 and RHEL 10 (rd.break and init=/bin/bash)
Resetting the root password is a core Linux skill for RHCSA prep and for recovering a production system. Two methods have historically been used on Red Hat Enterprise Linux:
- The
rd.breakmethod - The
init=/bin/bashmethod
The important thing to know up front: on RHEL 10, the rd.break method no longer works. It still applies on RHEL 9, but on RHEL 10 you must use init=/bin/bash.
On RHEL 9, both methods work. On RHEL 10, rd.break still drops you into the initramfs emergency shell, but the chroot binary was removed from the initramfs, so the chroot /sysroot step fails with chroot: command not found. Use init=/bin/bash (Method 2) on RHEL 10.
The RHCSA is offered on both RHEL 9 and RHEL 10, so which method you practice depends on which exam you sit. See Which Method for Which Version below.
Which Method for Which Version
There is no official mandate requiring one method over the other. Red Hat expects you to solve the problem with the tools available. Which methods are available, however, now depends on the release.
| Situation | Use |
|---|---|
| RHEL 9 (exam or production) | rd.break or init=/bin/bash (both work) |
| RHEL 10 (exam or production) | init=/bin/bash only (rd.break fails) |
On RHEL 9 you get to choose, and knowing both makes you resilient to:
- Boot failures where systemd may not start
- Environments with different init setups
- Recovery under pressure during exams or emergencies
Even on RHEL 10, where you must use init=/bin/bash, understanding how rd.break worked teaches you how the initramfs, chroot, and PID 1 fit together during boot.
Method Comparison
| Feature | rd.break | init=/bin/bash |
|---|---|---|
| RHEL version support | RHEL 9 only | RHEL 9 and RHEL 10 |
| Boot environment | Emergency shell | Minimal root shell |
| PID 1 process | systemd | bash |
| Reboot command works | Yes | No |
| Filesystem | Read-only initially | Read-only initially |
| SELinux relabel needed | Yes | Yes |
| Safe reboot method | exit (twice) | exec /usr/lib/systemd/systemd |
Method 1: Reset Root Password Using rd.break [RHEL 9 only]
This method works on RHEL 9. On RHEL 10 the emergency shell has no chroot binary, so step 6 fails. Use Method 2 on RHEL 10.
1. Reboot and access GRUB
When the GRUB menu appears, press e.
2. Locate the kernel line
Find the line beginning with linux or linuxefi, usually ending in:
rhgb quiet
3. Append rd.break to the end
rhgb quiet rd.break
4. Boot the system
Press Ctrl + x to boot into an emergency shell.
5. Remount the root filesystem
mount -o remount,rw /sysroot
6. Enter the real root filesystem
chroot /sysroot
7. Reset the password
passwd
8. Prepare SELinux relabeling
touch /.autorelabel
9. Exit and reboot
exit
exit
You will reboot, SELinux will relabel, and the login screen will appear.
Method 2: Reset Root Password Using init=/bin/bash [RHEL 9 and RHEL 10]
This is the method to use on RHEL 10, and it also works on RHEL 9.
1. Reboot and access GRUB
Press e at the GRUB screen.
2. Locate the kernel line
Look for the line starting with linux or linuxefi.
3. Edit the kernel line
Change ro to rw, remove rhgb quiet, and add init=/bin/bash at the end.
Example:
linux /vmlinuz-... rw init=/bin/bash
Changing ro to rw mounts the root filesystem writable from the start, so you can skip a manual remount.
4. Boot into the shell
Press Ctrl + x.
5. (If you left it as ro) remount root as writable
If you did not change ro to rw on the kernel line, remount now:
mount -o remount,rw /
6. Change the root password
passwd
7. Prepare SELinux relabel
touch /.autorelabel
8. Hand control back to systemd
exec /usr/lib/systemd/systemd
This lets the system finish booting normally and complete the relabel.
What Is PID 1 and Why Does It Matter?
Every process in Linux has a Process ID (PID). PID 1 is the first process started by the kernel. It manages system startup, services, and shutdown.
- Normally,
systemdis PID 1 - When you boot using
init=/bin/bash, bash becomes PID 1 - In this state,
rebootandexitwill not work properly - Use this command to hand control back to systemd:
exec /usr/lib/systemd/systemd
Verifying the Password Reset
After reboot, test root access:
su -
If your prompt changes to root@hostname, the reset worked.
RHCSA Practice Tips
The RHCSA runs on both RHEL 9 and RHEL 10, so practice the method that matches your exam:
- RHEL 9 exam: practice both methods. Use
rd.breakfor daily reps, and tryinit=/bin/bashweekly to understand boot and PID 1. - RHEL 10 exam: drill
init=/bin/bash. Do not rely onrd.break, it fails in the RHEL 10 emergency shell. - On either version, always remount root writable and relabel with
touch /.autorelabel. - Time yourself as part of exam prep.
Knowing when each method applies, and why rd.break stopped working on RHEL 10, gives you confidence for the exam and control in the real world.