Siege Lion on the Way (iii) Linux (15)---Default permissions and hidden permissions for files and directories

Source: Internet
Author: User

First, the file default permissions: Umask <== need to be subtracted from the permissions.

1, umask refers to the current user in the new file or directory when the default permissions, such as 0022;

2, by default, the user creates a file with a maximum permission of 666; The maximum permission to create a directory is 777.

3, the ultimate permission = Maximum permission-umask; <== Note here is not a direct numeric subtraction.

4, set Umask:umask 002;

5, by the above conditions, you judge the user to create a new file or directory of the final permissions.

Second, the hidden properties of the file: Chattr, Lsattr, hidden properties for the system security has a great help.

chattr [+-=] [asacdistu] file or directory name;

lsattr [-adr] file or directory.

1, can only be effective on EXT2/EXT3 file system.

2. Hidden properties can only be viewed through lsattr.

Third, the special permissions of the file: Suid\sgid\sbit (currently only understand)

1. The Set uid:s flag appears on the file owner's X-permission.

A, suid is only valid for binary programs.

B, the performer must have X's executable permission on the program.

C, this permission is only valid during the execution of the program (runtime).

D, the performer will have the permissions of the program owner.

2. The set Gid:s flag appears on the X permission of the file user group.

3. Sticky Bit:

chmod 4755 filename;

Iv. viewing file types: Gets the basic data for a file.

FILE/USR/BIN/PASSWD;

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.