How to reset the root the password in Centos

Last updated on 25th January 2016

If you have forgotten the root password on CentOS or other RHEL based Linux distributions, you can reset it easily bye following the steps below.

Boot the system to single user mode

Start the system and press any key within 3 seconds at the boot screen to enter the GRUB menu

CentOS boot

Once you are on the GRUB menu press 'a' to modify kernel arguments.

CentOS grub menu

Type in rhgb quiet single and press enter.

CentOS single user

This will take you to a root shell. To change the password simply type the command passwd

# passwd
Changing password for user root.

New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Type the command reboot and press enter to reboot the system.

# reboot

Login with your new password.


Post a comment

Comments

Nothing yet..be the first to share wisdom.