How can I quickly retrieve the root password in linux?

Source: Internet
Author: User
How can I quickly retrieve the linuxroot password after I forget the linux root password? Linux root password retrieval method 1
Step 2: use passwd root to change the status of a single user.
Step 2: use the CD to boot the system and run linux rescue to connect the original/partition as follows:
Cd/mnt mkdir hd mount-t auto/dev/hdaX (original/partition ID) hd cd hd chroot./passwd root
Step 2: Take the local hard disk and mount it to another linux system. The method is the same as the second one.
   Linux root password retrieval method 2
Step 2: when using lilo to boot the system: when lilo: prompt appears, type linux single
Lilo: linux single
Step 2: press enter to directly access the linux command line
Step 2: run the following command "vi/etc/shadow" to delete the contents of the first line, that is, the line starting with "root", "root", and "next, the first line is similar to root ::...... save
Vi/etc/shadow
Step 2: restart reboot. the root password is blank.
  Linux root password retrieval method 3
Step 1: When using grub to boot the system: when the grub screen appears, use the up/down key to select the one that you usually start linux (do not select dos), and then press the e key
Step 2: use the up and down keys again to select the one you usually start linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root = LABEL =/), and then press the e key
Step 2: modify the command line you see and add single. The result is as follows:
Kernel/boot/vmlinuz-2.4.18-14 single ro root = LABEL =/single
Step 2: press enter to return, and then press the B key to start, you can directly enter the linux command line.
Step 2: run the following command "vi/etc/shadow" to delete the contents of the first line, that is, the line starting with "root", "root", and "next, the first line is similar to root ::...... save
Vi/etc/shadow
Step 2: restart reboot. the root password is blank.
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.