About Linux Password forgetting problem solving method

Source: Internet
Author: User

Recently in the trial installation of CentOS, accidentally lost the password, not to go, check the information, found a method, the test was successful.
exist here, spare.

1. When the Grub screen appears, use the up and down keys to select the one you normally start Linux on, 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/vmlinuz-2.6.18-8.el5 single ro root=label=/rhgb quiet
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 (SHIFT+Z+Z)
(If not save, is the problem of file attributes, chmod 755/etc/shadow, so OK)
6. #reboot重启, the root password is empty

About Linux Password forgetting problem solving method

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.