How to Recover the Password for root on CentOS 5.7

In this post i will show how password recovery for lost root account’s password is performed. This is especially for those who always forgot their CentOS 5.7 root password. The steps is easy as below :

1. Reboot the CentOS machine
2. When booting up, press any key to go into the select menu.
3. The press ‘e’ to navigate to second grub.conf line (kernel)

recover
4. Press ‘e’ to edit the line :
recover
5. Add ‘single’ to “ro root=LABEL=/ single” as below :
recover
6. At ‘#’ command line, type ‘passwd’ to create new password. Then reboot machine as usual.
recover

2 Replies to “How to Recover the Password for root on CentOS 5.7”

  1. Thanks for the info, it helps a lot!

    I would add another step after 5, explaining that you need to press ‘b’ to continue booting and later ‘I’ in order to reach the # command line

    Thanks again

Leave a Reply

Your email address will not be published. Required fields are marked *