Friday, April 3, 2020
How to Reset the Forgotten Root Password in RHEL/Centos 8
First, boot into your RHEL/Centos 8 system and select the kernel you wish to boot into. Next, interrupt the booting process by pressing ‘e’ on your keyboard.
On the next screen, locate that begins with kernel= and append the parameter rd.break and press Ctrl + x. 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.
:/# mount | grep sysroot
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.
:/# mount | grep sysroot
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
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
Finally, type exit and then log out to begin the 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.
Subscribe to:
Post Comments (Atom)
-
VirtualBox is one of the most popular virtualization programs out there. It comes packed with a lot of powerful features and is a free open ...
-
First, boot into your RHEL/Centos 8 system and select the kernel you wish to boot into. Next, interrupt the booting process by pressing...
-
All files on a Linux system are stored on file systems which are organized into a single inverted tree ...
No comments:
Post a Comment