Root Password Reset from Boot Loader
One objective, asked in some form on almost every attempt. The procedure is six commands and the failure mode is always the same: the password is changed, the machine reboots, and the new password does not work - because `/etc/shadow` was written with the wrong SELinux label. That mechanism is demonstrated here on a running system.
Operating Running Systems Guide 24 of 67 Advanced
- OSRHEL 10.0 (Coughlan)
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 16 min
- Reviewed23 August 2026
Written against the versions above. `rd.break` drops you into the **initramfs** shell before the real root filesystem is handed over, which is why the disk is at `/sysroot` and mounted read-only. That is the whole reason for the `mount -o remount,rw` and the `chroot` - without both, you are editing a file in a temporary root that is about to disappear.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 (Coughlan) | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
Before you start
- Console access to the machine - physical, or a hypervisor console. SSH is not enough.
- The session creates and removes a test account and a labelled test file; it does not change root's password.
-
The boot arguments you will be editing
-
At the boot menu
-
Where the password actually lives
-
Remount, chroot, change
-
The SELinux step people skip
-
`/.autorelabel`, and the targeted alternative
-
Proving the change took
-
Stopping anyone else doing this