Recently in the trial installation of CentOS, accidentally lost the password, not to go, check the information, found a method, the test was successful.
exist here, spare.
1. When the Grub screen appears, use the up and down keys to select the one you normally start Linux on, and then press the E key
2. Use the up and down keys again to select the one you normally start Linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root=label=/), then press the E key
3. Modify the command line you see now, add single, the result is as follows:
Kernel/vmlinuz-2.6.18-8.el5 single ro root=label=/rhgb quiet
4. Enter return, then press B to start, you can go directly to the Linux command line
5. #vi/etc/shadow
Delete the first line, that is, Root: The previous and Next:
The first row will resemble
Root:: .....
Save (SHIFT+Z+Z)
(If not save, is the problem of file attributes, chmod 755/etc/shadow, so OK)
6. #reboot重启, the root password is empty
About Linux Password forgetting problem solving method