Linux system root password forgot what to do three ways to quickly retrieve the root password

Source: Internet
Author: User

Linux Root Password retrieval method One
1th step: In the system into a single user state, directly with passwd root to change.
2nd Step: Boot the system with the installation CD, the Linux rescue State, the original/partition hook up, as follows:
cd/mnt mkdir HD mount-t auto/dev/hdax (original/partition number) HD CD HD  Chroot./passwd Root
Step 3rd: Take down the hard drive of this machine and hang it on other Linux systems, using the same method as the second.
Linux Root Password retrieval method Two
1th step: When you boot the system with Lilo: Type Linux single
screen when the Lilo: prompt appears lilo:linux single
Step 2nd: Back The car can go directly to the Linux command line
3rd: Use the following command "Vi/etc/shadow" to delete the first line, that is, Root: After and Next: The first row is deleted from the previous one, and a row will resemble root:: ... Save
Vi/etc/shadow
4th step: Reboot reboot, the root password is empty.  
Linux Root Password retrieval method Three
1th step: When booting the system with grub: When the Grub screen appears, use the up and down keys to select the one you normally start Linux (do not choose Dos yo), then press the E key
2nd step: Use the upper and lower keys again to select the one you normally start Linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root=label=/), and then press the E key
3rd step: Modify the command line you see now, add single,  The results are as follows:
kernel/boot/vmlinuz-2.4.18-14 single ro root=label=/single
Step 4th: Enter back, then press B to start, and go directly to the Linux command line.
5th: Use the following command "Vi/etc/shadow" to delete the first line, that is, Root: After and Next: The first row will be similar to root:: ... Save  : wq!

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

Linux system root password forgot what to do three ways to quickly retrieve the root 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.