Five methods to restore the Linux password after the linux password is forgotten

Source: Internet
Author: User
Introduction to five methods for restoring the linux password: when you learn linux, you may encounter a problem of forgetting or losing the password. here we will introduce the solution to the linux password recovery problem.

Introduction to five methods for restoring the linux password: when you learn linux, you may encounter a problem of forgetting or losing the password. here we will introduce the solution to the linux password recovery problem, I will share it with you here. 1. lilo Boot 1. When lilo: prompt appears, type Linuxsingle Boot: Linuxsingle 2. press enter to directly enter Linux single user

When you learn about linux, you may encounter a password forgotten or lost Problem. here we will introduce how to solve the linux password recovery problem. here we will share it with you.

I. lilo guidance
1. When lilo appears: enter Linuxsingle
Boot: Linuxsingle
2. press enter to directly enter Linux single user mode
3. vi/etc/passwd
Delete the password from the root account
(You can also use the passwd command to reset the root password)
4. restart reboot. the root password is blank.

II. grub boot
1. when the grub screen appears, select the Linux boot item and press e.
2. select a line starting with kernel and press the e key. at the end of the line, press the space key and enter single to exit the editing mode with the enter key;
3. press enter to return, and then press the B key to start, you can directly enter Linux single user mode
4. vi/etc/passwd
Delete the password from the root account
(You can also use the passwd command to reset the root password)
5. restart reboot. the root password is blank.

3. boot a floppy disk in Linux
Enter Linuxsingle
You can enter the single-user mode;
Modify or delete the root password; (reprinted please note: http://www.linuxso.com)

4. Use a Linux system to install a disk
If you do not have a system boot floppy disk and the multi-system boot LILO and GRUB are deleted, you can only use the Linux system installation disk to implement the linux password restoration technology.
Start with the first Linux system installation disk. enter the following command after the boot prompt is displayed:
Oot: Linuxrescue
At this time, the system enters the rescue mode and completes as prompted:
1. select the language and keyboard format;
2. select whether to configure the NIC. Generally, the NIC configuration can be skipped because the network is not required;
3. select whether to allow the system to search for the RedhatLinux system on the hard disk and choose to continue;
4. The system displays that the system on the hard disk has been found and mounted to/mnt/sysimage;
5. enter the rescue status. you can reset the root password:
# Chroot/mnt/sysimage (make the system a root environment)
# Cd/mnt/sysimage
# Passwdroot

5. remove the hard disk and attach it to another machine.
If you are not afraid of trouble, you can also detach the hard disk for Linux installation and mount it to other system environments. you can also modify the/etc/passwd file and save the modification;
Note:
1. there may be differences between single input methods and methods in different Linux systems, hoping to try it on your own;
2. in addition to the/etc/passwd file, you may also need to modify the/etc/shadow file, which is the projection file of the/etc/passwd password file.

The above describes how to restore the linux password.

Related Article

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.