How to prevent others from modifying some important files in Linux

Source: Internet
Author: User
Keywords Linux important files
Tags change configuration data example file files how to how to prevent

Wind Network (ithov.com) original article: In the process of managing Linux systems, for some important key documents, configuration files and important personal data, often do not want users to make arbitrary changes, this time we need to the file to protect the rights to prevent tampering with the file, We can change the properties of the file to 600.

For example:

[Root@localhost/]# chmod 600/usr/local/webserver/nginx/conf/nginx.conf

This allows us to set the/usr/local/webserver/nginx/conf/nginx.conf file to 600 permissions to prevent modification.

Also, if Linux uses a ext2, ext3, or Ext4 file system, you can use the "chattr" command:

usage:chattr [-RVF] [-+=aacddeijssu] [v-version] files ...

Add the I attribute to the important file, even if the root user cannot modify or delete the file directly to effectively prevent accidental modification or http://www.aliyun.com/zixun/aggregation/18137.html "" "" "" "" "" ". The specific orders are as follows:

# chattr +i passwd

Add the attribute of I to the passwd file

Remove the I attribute using the following command:

# chattr–i passwd

Remove the properties of the passwd file I and make changes to the file.

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.