There are three ways to fix Linux forgetting the root password:
The first of these is detailed below:
After restarting the system, the Grub interface appears on the boot loader menu, using the UP and DOWN ARROW keys to select the system you forgot your password for, type "E" to enter edit mode.
- 2
Next you can see the screen as shown, then you use the up and down keys to select the latest kernel (here is the second line, kernel ...). ), and then continue to press the "E" key.
- 3
Then add "Space" to the edit interface rhgb quiet, and then type "single", or enter the number "1" directly and return to OK.
- 4
After Enter, press "B" key to launch into single user mode, here to change the root password.
- 5
After this reboot, the root password has been modified!
The second approach:
1th step: When using Lilo to boot the system: type Linux single when the Lilo: prompt appears
Screen Display Lilo:linux single
2nd step: Enter directly into the Linux command line
3rd: Use the following command "Vi/etc/shadow" to delete the first line, that is, Root: After and Next: The first row will be similar to root:: ... Save
Vi/etc/shadow
4th step: Reboot reboot, the root password is empty.
The third approach:
1th step: In the system into a single user state, directly with passwd root to change.
2nd Step: Boot the system with the installation CD, the Linux rescue State, the original/partition hook up, as follows:
CD/MNT mkdir HD mount-t auto/dev/hdax (the partition number where the original/partition is located) HD CD HD chroot./passwd Root
The 3rd step: Take down the hard drive of this machine and hang it on the other Linux system, using the same method as the second one.
Linux Forgot roo Password solution