Why and how to solve the Linux server after a serious failure

Source: Internet
Author: User
Tags chmod

1. Insert the system installation CD, reboot the machine, press the DEL key when it starts, enter the CMOS, turn the boot order into the CD first, start the Linux installation program, press F5, press the hint to enter the Linux rescue carriage return, enter the rescue mode, and then select the language and keyboard, Direct return, the program prompts you to install the Linux system on the hard drive under/mnt/sysimage, and then the Super User prompt appears.

2, into the hard disk etc directory: CD/MNT/SYSIMAGE/ETC, first do backup to prevent accidents:

CP Shadow Shadow.old Modify shadow file properties to be writable: chmod +w Shadow then use VI to modify: to find the line with root user information: root: ... :, between the first two colon is an encrypted password, delete it (the colon can not be deleted), save the exit. So the root password is empty.

will not use VI users can take the following methods: Find a DOS disk inserted into the floppy drive, the shadow copy to the DOS disk: Mcopy shadow a:/ Then, under Windows, with Notepad in the attachment, note that the open file type must be selected for all Files (*.*), Save and exit.

And the last one to copy back:

Mcopy A:/shadow mnt/sysimage/etc

3, the shadow attributes back to read-only: Chmod-w shadow, the last input exit, remove the disc.

4, for the sake of safety, restart should be in the terminal window and then add the password to the root.

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.