Reset CentOS root Password
Client gave me a big challenge!!! They lost the CentOS root password…
I has tried for 30mins to recover the password, but still fail… and the big problem is, this office have no internet access!!!
No choice but I have to get this solved… so I walk down and search for a cafe with internet connection and I found this solution.
1. Shut down the machine. (Ctrl+Alt+Del)
2. When it reboot and reach the CentOS boot up screen, then press any key to go into a select menu. Then press “e” and navigate to the second line “grub.conf” line (kernel) and press “e” to edit the line to
- option 1 : <SPACE> 1 (” 1″) at the end of the line. OR
- option 2: <SPACE> S (” S”) a the end of the line OR
- option 3: add “single” to “ro root=LABEL=/ single”
Then hit “ENTER” and press ‘b’ to reboot.
After it reboot, and stop at ‘#” command line, type “passwd” to create the new root password.
Reboot the machine as usual and access your root with new password.
awesome…u know this trick now,
You should say I am lucky to find this trick… else I’ll be spending whole day at the client office just to re-install the system.
Thanks a Zillion !!
We had a admin leaving, and not giving his password.. this did the trick !!
You’re the man! Saved my day! Thx a lot.
Great guide, saved me the day ty
If single mode is set password, how can I to reset?
You’re my HERO!!!!! you saved me a hundred bucks. i owe you a round of ice-cold-beer.