How to reset root password in CentOS 7 / RHEL 7

There may be some times you forgot your root password and want to reset.So here is the guide to reset your root password in CentOS 7. To achieve this you have to boot your system in single user mode.

After that chroot your system

chroot /sysroot

reset the root password.


Update SELinux information.

touch /.autorelabel

Exit chroot


Reboot your system.


Login with your new password.

That’s all there is to do and it is that simple to reset root password in centOS 7. Hopefully that helps and do comment below sharing your thoughts and experiences