Linux Articles Linux Training

How To Recover Forgot Root User Password In Centos/RHEL

How To Recover Forgot Root User Password In Centos/RHEL

In general case sometimes we forgot root account password or might be need to reset root account password.It’s well known form many people that we can perform this through Single usermode. Here is the simple solutions that makes to reset root user account password,

This method will help to reset Root user password for RHEL and Centos aswell.

Note: Only Root user can reset the password for Root account other

Steps:

– Reboot the machine and hit ‘e’  to edit that will allow you to enter the single user mode.


– Now find ‘rhgb quiet’ if it is not there after the LVM information like next to ‘crashkernal’ enter ‘init=/bin/bash’


– And do CTRL+x , it will boot with the bash prompt.


– By using the following command check the root partition permission.
#mount | grep root


– Many cases root partition will be read-only mode.
– remount the partition with r,w permission. Use the following command,
#mount -o remount,rw /


– Now check the root partition is mounted with r,w permission mode,
#mount | grep root
– You can do the password change now ,
#passwd root
[Enter New Password] [Re-enter New password] – Check the file system write mode now,
#touch /.readableone

– Reboot the system and try to login now using the changed password,
#exec /sbin/init

Tags:linux,reboot,password reset,Centos,Centos7,mytecharticle,technews,windows article,redhat

About the author

admin

Add Comment

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.