Original address : http://www.cnblogs.com/younes/archive/2010/01/19/1651746.html author : Unity of knowledge and line
[1] When you see the boot menu: Select the kernel kernel (recovery mode) to start and press E. into a new interface.
[2] Move the cursor to the kernel line, press E again, and enter the Grub edit screen.
[3] Change the RO to RW, add a statement: Init=/bin/bash, move the cursor to the end of the line, enter, return to the previous screen.
[4] Press B (the cursor remains on the kernel line) and the system starts.
[5] When you see a familiar # prompt, you can now use vi,less, a variety of tools to view the/etc/passwd file, locate the user name, and then use the command passwd username to modify the username password. or use the Useradd command to add a new user, and note that you can use the passwd newuser to log on using NewUser.
[6] Restart the computer and log in with the new password. Done.