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.