Close Menu
DPC Virtual Tips
    Read More

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Monday, August 24
    DPC Virtual Tips
    • Home
    • Operating Systems
    • PowerFlex
    • HPC
    • Virtualization
    • About the Author
    • About Us
    • Contact
    DPC Virtual Tips
    Home » Resetting the root password on RHEL 8
    Operating Systems

    Resetting the root password on RHEL 8

    DaniloBy DaniloJuly 24, 2025Updated:August 1, 2026No Comments2 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Reset root password on RHEL 8
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Resetting the root password on RHEL 8 shows a procedure to reset the root password.

    As a system administrator, it’s essential to store all the system’s passwords securely. However, what do you do if you lose the root password for a specific system? What do you do if you do not have a non-root user with sudo permissions? This is the worst situation, and you, as a system administrator, must be prepared to handle it.

    We will show a procedure to reset the root password by booting the system into the special mode. In this mode, the boot process stops before the system hands over control from the initramfs to the actual system.

    Procedure

    1- Reboot the system and, on the GRUB boot screen, press the e key to interrupt the boot process:

    2- Set the cursor to the end of the line that starts with linux:

    3- Append rd.break to the end of the line that starts with linux:

    4- Press Ctrl+x to start the system with the changed parameters. The switch_root prompt appears:

    5- By default, the file system is mounted as read-only in the /sysroot directory. Remounting the file system as writable allows you to change the password:

    mount -o remount,rw /sysroot

    6- Enter the chroot environment:

    chroot /sysroot

    7- Reset the root password:

    passwd

    8- Enable the SELinux relabeling process on the next system boot:

    touch /.autorelabel

    9- Exit the chroot environment:

    exit

    10- Exit the switch_root prompt, to reboot the system:

    exit

    Note: Wait until the SELinux relabeling process is finished. Note that relabeling a large disk can take a considerable amount of time. The system reboots automatically when the process is complete

    Verification

    Log in as the root user by using the new root password:

    That’s it 🙂

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHandling Target System State on RHEL 8
    Next Article SSH Passwordless Authentication on RHEL 8
    Danilo

    Infrastructure Engineer with experience in Virtualization, Linux, Windows Server and learning automation using Python. DPC Virtual Tips was created to share practical tutorials, lab experiences and troubleshooting guides focused on enterprise infrastructure technologies.

    Related Posts

    Linux Server Has Free Memory but Is Swapping: Why?

    August 13, 2026

    How to Determine Whether Packet Loss Is Local or Network Related on Linux

    August 12, 2026

    How to Investigate TCP Retransmissions on Linux

    August 11, 2026

    Comments are closed.

    Search
    Categories
    • HPC (12)
    • Operating Systems (85)
    • PowerFlex (22)
    • Virtualization (130)
    Read More
    Virtualization

    How to Troubleshoot Packet Drops on an ESXi Host

    By DaniloAugust 16, 20260
    HPC

    SlurmDBD Is Down: What Continues Working and What Does Not

    By DaniloAugust 15, 20260
    HPC

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    By DaniloAugust 14, 20260
    Operating Systems

    Linux Server Has Free Memory but Is Swapping: Why?

    By DaniloAugust 13, 20260
    Operating Systems

    How to Determine Whether Packet Loss Is Local or Network Related on Linux

    By DaniloAugust 12, 20260
    Latest Posts

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    Images from Gallery
    hpc main commands
    linux commands
    install rock linux
    lustre fs
    shell scripting
    vSAN Trace Files
    Categories
    • HPC
    • Operating Systems
    • PowerFlex
    • Virtualization
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Copyright © 2026, DPC Virtual Tips. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies to ensure your best experience on our website. If you continue using our website, we'll assume you agree to our cookie policy