Linux forgot Password

Source: Internet
Author: User

Linux forgot Password

This article was tested on Rh8 by

One. Lilo
1. When the Lilo appears: Type Linux single when prompted
Screen Display Lilo:linux single
2. Enter to enter the Linux command line directly
3. #vi/etc/shadow
Delete the first line, that is, Root: The previous and Next:
The first row will resemble
Root:: .....
Save
4. #reboot重启, the root password is empty

Two. Grub

1. When the Grub screen appears, use the up and down keys to select the one you normally start Linux (do not select Dos yo), 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/boot/vmlinuz-2.4.18-14 single RO root=label=/
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
6. #reboot重启, the root password is empty.

The following are other users of the supplement, we can refer to the following:

First, enter the single user mode
 
1. Booting a floppy disk using the Linux system
If you have created a bootable floppy disk for your Linux system and set up your computer system to boot from a floppy disk, enter: Boot:linux single system enters a one-user mode with a prompt of "#" and a computer-booted runlevel
1, the local file system is mounted, many system services are not running, skipping all system authentication, is a system administrator to use a specific machine, the root file system to hang read and write, at this time you can use:
(1) passwd program to set a new password for root
# passwd Root
# reboot
After rebooting the system, the root password has been updated.
(2) Delete the root password by modifying the/etc/shadow file
# CD/ETC
# VI Shadow

Delete the contents of "root:" and the Next ":" In a line starting with root.
The first line will be similar to "root::?", reboot the system after saving, and the root password will be empty.
2. Start with the LILO multi-system boot Program
When the system starts with the Lilo boot program, enter when the Lilo prompt appears:
Lilo:linux Single
After entering a single user, change the password method with 1.
  3.to GrubMulti-system boot program boot  
With Grub
To boot the system into a single user step:  
(1)
Start Grub, select red Hat Linuxoption, and then type Eto edit;  
(2)
Select to Kernelstart with a line, and then press ekey, at the end of this line, press SPACEBAR to enter singleTo exit the edit mode with the Enter key; 
(3)
back to GRUB.screen, type Bto boot into single-user mode. after entering a single user, change the passwordthe method of the same 1.  
Second, the use of Linux system installation disk
If you do not have a system boot floppy disk, and multiple system boot Lilo and grub are removed (such as after reinstalling the Windows system), you can only use the Linux system installation disk to restore the root password.
Start with the first Linux system installation disk and enter it at the boot prompt:
Oot:linux Rescue
At this point the system enters rescue mode and then completes according to the prompts:
1. Select the language and keyboard format;
2. Choose whether or not to configure the network card, the general system is not necessary because of networks, so you can choose whether 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;
4. The system shows that the system on the hard drive has been found and is mounted under/mnt/sysimage;
5. Enter the rescue status to reset the root password:
# chroot/mnt/sysimage (Let the system become the root environment)
# Cd/mnt/sysimage
# passwd Root

Linux forgot Password

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.