Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Reset Forgotten Root Password in RHEL 8 - DesignLinux

May 29 2020
designlinux 0 Comments

In this guide, you will learn how to reset a forgotten root password on RHEL 8 server. Resetting the root password usually involves a few steps that will help you to reset the root password and you will thereafter be able to log in using the new root password.

Related Read: How to Reset Forgotten Root Password in CentOS 8

So let’s dive in..

Reset Forgotten root Password in RHEL 8

First, boot into your RHEL 8 system and select the kernel you wish to boot into. Next, interrupt the booting process by pressing ‘e’ on your keyboard.

RHEL 8 Boot Menu

RHEL 8 Boot Menu

On the next screen, locate that begins with kernel= and append the parameter rd.break and press Ctrl + x.

Append Kernel Parameter

Append Kernel Parameter

On the next screen, ensure that you remount the sysroot directory with read and write permissions. By default, it is mounted with read-only access rights indicated as ro.

You can confirm this by running the command:

:/# mount | grep sysroot
Confirm Sysroot Directory Permissions

Confirm Sysroot Directory Permissions

Now remount the directory with read and write access.

:/# mount -o remount,rw /sysroot/

Once again, confirm the access rights. Note that this time, the access rights have changed from ro (read-only) to rw (read and write).

:/# mount | grep sysroot
Confirm Directory Permissions

Confirm Directory Permissions

Next, run the command shown to mount the root file system in read and write mode.

:/# chroot /sysroot

Next, use the passwd command to reset the password. As usual, provide a new password and confirm it.

# passwd
Reset Root Password

Reset Root Password

At this moment you have successfully reset your password. The only part remaining is to enable file system relabelling. To do this execute:

:/# touch /.autorelabel
Enable File System Relabelling

Enable File System Relabelling

Finally, type exit and then log out to begin the relabelling process.

SELinux Relabelling Process

SELinux Relabelling Process

This usually takes a couple of minutes and once done, the system will reboot upon which you can log in as the root user with the new password.

Reboot RHEL System

Reboot RHEL System

And that’s how you would reset a forgotten root password in RHEL 8.

Sharing is Caring…
Share on FacebookShare on TwitterShare on LinkedinShare on Reddit

Related

Tags: RHEL Tips

Learn Python Identity Operator and Difference Between “==” and “IS” Operator

Prev Post

How to Set Up IPsec-based VPN with Strongswan on CentOS/RHEL 8

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 336
  • 565,095

DesignLinux.com © All rights reserved

Go to mobile version