In some cases, the root password in Red Hat Enterprise Linux (RHEL) may be forgotten, or it might be changed by unauthorized access, preventing you from logging into the system.
In such situations, you need to reset the root password. To start the recovery process, reboot your RHEL system.
Step 1: Reboot the System and Access the GRUB Menu
When the system starts, access the GRUB boot menu:
- For UEFI systems: Press the Esc key repeatedly during boot.
- For BIOS systems: Hold down the Shift key while the system is starting.
Step 2: Edit Kernel Options
- In the GRUB menu, select the kernel you want to boot and press e to enter the edit mode.

Once you do this, you will see a screen similar to the one below:

Step 3: Modify the Kernel Line
”dd rhgb quiet”
Move the cursor to the end of the line containing:
rd.break console=tty1
Then append the following parameters:
After adding this, press Ctrl + X to continue booting the system.
Step 4: Access the Root Filesystem
After booting, the system will drop you into a terminal interface. To gain write access to the root filesystem, run:
mount -o remount,rw /sysroot
chroot /sysroot
remount: Remounts the filesystem at its current mount point.
rw: Grants read and write access (by default, recovery mode mounts it as read-only).
This step ensures that you can modify the root filesystem.
Step 5: Reset the Root Password
Now, you can reset the root password by entering:
Enter your new password when prompted.
If SELinux is enabled, you should relabel the filesystem to update its security contexts:
passwd root
touch / .autorelabel
Note: If SELinux is disabled, this step is not necessary.
By following these steps, you can successfully reset the root password on Red Hat Enterprise Linux (RHEL) and regain access to your system.
exit
Restart:
reboot
What Are rd.break and console=tty1?
- rd.break: This parameter instructs the system to start a shell during the initramfs stage, allowing you to perform emergency or recovery tasks.
- console=tty1: Redirects all console messages to the tty1 screen, making it easier to interact with the recovery shell.
After completing the recovery process, review your new root password and security measures, such as SSH access policies, to maintain system security.