A fiend of mine need to access a CentOS machine, but he doesn't have the password.
He does not want to reinstall the OS (whatever the reason)
Is there a way to regain access to the root account without reinstalling?
A fiend of mine need to access a CentOS machine, but he doesn't have the password.
He does not want to reinstall the OS (whatever the reason)
Is there a way to regain access to the root account without reinstalling?
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.
that is a very good solution said by triantares compatible and that wont require anything "extra"
another similar one is also using a Live system:
in short, this is a very simple and easy way to "crack" any linux system and to have access to all its data, you got root and full RW (except if the disk is encrypted, that's why is the only way to protect yourself really)
Limitations: