Linux server after a serious fault handling method

  
                  

1, insert the system installation CD, restart the machine, press the Del button quickly when booting, enter the CMOS, change the boot sequence to the CD first, then start the Linux installation program, press F5, press the prompt to enter Linux Return to the rescue mode, enter the rescue mode, then select the language and keyboard, you can directly press Enter, the program prompts that the Linux system on the hard disk has been installed to /mnt/sysimage, and then the super user prompt appears.

2, enter the hard disk etc directory: cd /mnt/sysimage/etc, first do backup anti-failure:

cp shadow shadow.old modify the shadow file properties to be writable: chmod +w shadow Then modify it with vi: find the line containing the root user information: root:....:, the encrypted password between the first two colons, delete it (the colon can not be deleted), save and exit. Then the root password is empty.

Users who do not use vi can take the following method: find a DOS disk into the floppy drive, copy the Shadow to the DOS disk: mcopy shadow a: /Then modify the file with the notepad in the attached file under Windows , pay attention to open the file type must select all files (*.*), save and exit.

The last copy back:

mcopy a:/shadow mnt/sysimage/etc

3, change the Shadow property back to read-only: chmod -w shadow, finally Enter Exit to exit and remove the disc.

4. For security reasons, you should add a password to root in the terminal window after rebooting.

Copyright © Windows knowledge All Rights Reserved