Skip to main content

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.break method
  • The init=/bin/bash method

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.

RHEL 10 changed this

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.

SituationUse
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)
Why learn both

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

Featurerd.breakinit=/bin/bash
RHEL version supportRHEL 9 onlyRHEL 9 and RHEL 10
Boot environmentEmergency shellMinimal root shell
PID 1 processsystemdbash
Reboot command worksYesNo
FilesystemRead-only initiallyRead-only initially
SELinux relabel neededYesYes
Safe reboot methodexit (twice)exec /usr/lib/systemd/systemd

Method 1: Reset Root Password Using rd.break [RHEL 9 only]
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]
Works on both

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?

tip

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, systemd is PID 1
  • When you boot using init=/bin/bash, bash becomes PID 1
  • In this state, reboot and exit will 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.break for daily reps, and try init=/bin/bash weekly to understand boot and PID 1.
  • RHEL 10 exam: drill init=/bin/bash. Do not rely on rd.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.