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)

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

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

  • Victor Dias

    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 *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>