Lost password in CentOS

There is:
Boot into the GRUB window (some distros require holding "shift" for that) and hit "e" for edit.

Go to the kernel line and remove "quiet splash" and add " init=/bin/bash" and let it boot.
Then once the command prompt is there:
"mount -o remount,rw /"
and
"mount -o remount, rw /proc"

Then (for root password):
"passwd" and subsequently change password
This will set a password for root. [Create a new password for the $USER once it's rebooted and logged in as root].
and don't forget to do:
"sync"
Then "reboot" and login as root to administer the system as wanted.

2 Likes