Linux root password three ways to retrieve

Source: Internet
Author: User
Tags first row

Linux root password Retrieve method a

1th step: In the system into a single user state, directly with passwd root to change.

2nd: The installation of CD-ROM boot system, Linux rescue State, the original/partition hook up, the following practices:

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, hang on to other Linux system, adopt the method and the second kind is same.

  Linux root password Retrieve method two

Step 1th: When you boot the system with Lilo: Type Linux single when the Lilo: prompt appears

Screen Display Lilo:linux single

2nd step: Enter directly into the Linux command line

Step 3rd: Use the following command "Vi/etc/shadow" to delete the first row, which begins with Root: After and next: Before, the first line is similar to root:: ... Save

Vi/etc/shadow

4th step: Reboot reboot, the root password is empty.

  Linux root password Retrieve method three

1th Step: When you boot the system with grub: When the Grub screen appears, use the up and down key to select the one you normally start Linux (do not choose Dos yo), and then press e key

2nd step: Again use the up and down key to select the one you normally start Linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root=label=/), and then press e key

Step 3rd: Modify the command line you see now, add single, and the result is as follows:

Kernel/boot/vmlinuz-2.4.18-14 single RO root=label=/single

4th step: Enter return, and then press the B key to start, you can go directly to the Linux command line.

Step 5th: Use the following command "Vi/etc/shadow" to delete the first row, which begins with Root: After and next: Before, the first line is similar to root:: ... Save

Vi/etc/shadow

6th step: Reboot reboot, the root password is empty.

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.