Beginners Learn Linux-hidden properties of files/folders

Source: Internet
Author: User

The file/folder actually has hidden properties? Yes, hidden properties are important for File/folder security. For example, we need to use "qualifier" to uncover the hidden properties of the rig, and Chattr/lsattr is the "qualifier" in Linux.

CHATTR basic format is: Chattr +-=[ACDEIJSTUADST]. + indicates a hidden attribute is added;-Indicates that a hidden property is removed; = indicates that the hidden property is set directly. Man chattr:

The letters ' ACDEIJSTUADST ' Select the new attributes for the files: append Only (a), Compressed (c), no dump (d) , extent format (e), immutable (i), Data journalling (j), secure deletion (s), no tail-merging (t), undeletable (u), no atime updates (A), Synchronous directory Updates (D), synchronous Updates (S), and top of directory hierarchy (T) .

Looking at these hidden properties, a and I are more domineering. After a is set, then for a file, can only add data, delete and modify data are prohibited (is not more applicable to the log file?). )。 Set I, the file will not be added/modified/deleted data.

Here's how to use the "qualifier" below Linux, in the following steps:

1. Create File: Attrtest.txt

2. View hidden Properties

3. Set hidden properties: +i

4. Attempt to delete the file (attempt to delete failed)

The above steps, if you set the folder again, what will be the result?

1. Create folder: Attrtestfolder

2. View hidden Properties

3. Set hidden properties: +i

4. Try to add files to the folder or delete the folder (both failed)

More about chattr/lsattr, or man!

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.