Source: Red and Black Alliance http://www.2cto.com/os/201411/348545.html
In the process of using Linux, sometimes forget the root user's password (especially when the handover and the content of the document is not complete), this time we can enter the single-user mode to reset the root user password. Here's how to reset the root password, or how to hack the root password.
System environment: centos6.5 Mini/rhel 6.3
1, restart the server, at the time of reading the second press any key, will appear the following interface in this interface press the "E" in the keyboard to enter the GRUB mode
2, in 1, press E will enter the following interface.
Move the cursor to the kernel line, and then press ' E ' again, enter kernel the line's edit interface 3, in the kernel edit interface, click the SPACEBAR, and then enter single, and press ENTER ENTER to exit kernel Edit Interface 4, Exit Kernel interface will go back to the Grub mode interface, the interface again to move the cursor to the kernel line, and then press ' B ' to start system 5, this time the system will come to single-user mode, do not need to enter any password can be directly into the system in single-user mode, We can change the password directly, after the password is changed, the system will be restarted
LINUX/CENTOS6 Forgot root Password solution