5 ways to solve the Linux system password forgotten

  

A. lilo boot
1. In the lilo: prompt type linux single
Boot: linux single
2. Enter directly into linux Single User Mode
3. vi /etc/passwd
Delete the password in the root entry
(You can also use the passwd command to reset the root password directly)
4. reboot reboot, the root password is Empty
2. grub boot

1. When the grub screen appears, select the linux boot entry, then press the e key
2. Select the line starting with the kernel and press the e key At the end of the line, press the space bar and type single. Press Enter to exit the edit mode.
3. Press Enter to return, then press b to start, you can enter linux single-user mode directly
4 Vi /etc/passwd
Delete the password in the root entry
(You can also use the passwd command to reset the root password directly)
5, reboot reboot, the root password is empty
Third, you can use linux boot floppy boot

After boot, enter linux single
can enter single user mode;
modify or delete root password;
Using the Linux system installation disk

If you do neither boot floppy disk, and multi-system boot LILO and GRUB has been deleted, you can only use Linux system installation disk to restore the root password.
Start with the first Linux system installation disk, enter the boot prompt:
oot: linux rescue
At this point the system enters rescue mode, and then complete the prompt:
1. Select the language and Keyboard format;
2. Select whether to configure the network card, the general system does not need the network, so you can choose not to skip the network card configuration;
3. Choose whether to let the system find the Redhat Linux system on the hard disk, choose to continue; Br> 4. The system shows that the system on the hard disk has been found and mounted under /mnt/sysimage;
5. Enter the rescue state, you can reset the root password:
# chroot/mnt/sysimage ( Let the system become the root environment)
# cd /mnt/sysimage
# passwd root
Five, if you are not afraid of trouble, you can also remove the hard disk after installing linux and hang it in other system environments.

The same is to modify the /etc/passwd file, save it after modification;
Note:
1, in different Linux systems, the method and method of entering single may be different, I hope to Try it yourself;
2, in addition to the need to modify the /etc/passwd file, it may also need to be repaired /Etc /shadow file, which is a projection file /etc /passwd password file.

Copyright © Windows knowledge All Rights Reserved