Solution to accidental file deletion on Linux server

Source: Internet
Author: User
Linux server operations are already very simple, but it is inevitable that some people will make some small errors, such as accidental deletion of files, this article will tell you how to quickly solve this problem. The server accidentally deleted usrbin and

Linux server operations are already very simple, but it is inevitable that some people will make some small errors, such as accidental deletion of files, this article will tell you how to quickly solve this problem.

The server accidentally deleted the/usr/bin and/usr/sbin directories, and copied these two directories from other places. many of them may be non-common files such as links, when the link can be copied, I do not know what parameters should be added to the link processing. therefore, more than one hundred MB of data is copied to nearly one G. Finally, I gave tar a copy and copied it.

In this way, the server is basically ready. we recommend that you:

1. do not log on directly with root, especially unfamiliar users.

2. we recommend that you use sudo to execute the root command and use less su;

3. use mongodo to configure the root permission command to be executed.

Eg: xxx ALL =/sbin/mount,/sbin/unmount,/sbin/ifconfig NOPASSWD: ALL

The rm command does not work. However, there are "sequelae ":

1. during login, 'Linux ': unknown terminal type;

2. when top, clear (known) is used, it is caused by the terminal type problem;

3. vim is also a similar problem and cannot be operated; it has been resolved, but it can only be used in the basic mode;

4. the tftp and telnet services have been resolved.

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.