Linux Learning notes----The relationship between permissions and commands (very important)

Source: Internet
Author: User
I. The relationship between authority and command

    

Ii. default permissions and hidden permissions for files and directories

1) umask The default permissions for your system (through Umask-s).

  

Umask's score refers to the permission that the default value needs to be lost, such as umask=022, which is u=7-0=7,g=7-2=5,o=7-2=5; that is, 755

  2) Hidden Properties of File chattr,lsattr (show file hidden properties)

chattr [=-=][asacdistu] most commonly used is a and I, where a means that the file can only add data, not delete data or modify data. Only Root has this permission. I mean to have a file cannot be deleted, renamed, set link also cannot write or add data. Such as

    

    

  3) Hide Permissions

In addition to the owner,group,others of three privileged identities, there are rwx suid,sgid,sbit

For Suid, when this permission is added, X becomes S, for example, if a user wants to modify a password that only the root can modify, how do you do it?

  

For Sgid, when the S flag is suid for the file owner's X project, that s is sgid when the user group is x. Such as

  

For sbit It is only valid for the directory. When you add directory A with Sbit permissions, you can only delete files or directory-level deletions that you have created, and so on, without deleting others ' files.

Then how to join the above three kinds of permissions, then like rwx these three permissions, suid=4,sgid=2,sbit=1; Just add a number to the RWX permission. For example:

  

Linux Learning notes----The relationship between permissions and commands (very important)

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.