Linux File system permissions (ii)

Source: Internet
Author: User




Special permissions



Effects of special permissions on files:


U+w (SUID) executes the file as the user who owns the file, not as the user who runs the file


G+s (Sgid) executes the file as a group that owns the file


O+t (sticky) no impact



Impact on the directory:


U+w (suid) No impact

G+s (Sgid) The newly created file in the directory sets its group owner to match the group owner of the Directory


O+t (sticky) users who have write access to the directory can only delete all of their files, but cannot delete or force them to files owned by other users


Example:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/77/77/wKioL1ZoU47xLtp6AABeTpB_pxo693.png "title=" Rhce7-classroom-2015-12-10-00-10-50.png "alt=" Wkiol1zou47xltp6aabetpb_pxo693.png "/>





Default File Permissions


The default permissions for files are set by the process that created them.

These permissions are typically not set when new files and directories are created, some of which are purged by the umask of the shell process.

Running the umask command without parameters will display the current value of the Shell's Umask

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/77/78/wKiom1ZoTPbzIFnFAAAZ5-7xB9A222.png "title=" Rhce7-classroom-2015-12-09-23-46-01.png "alt=" Wkiom1zotpbzifnfaaaz5-7xb9a222.png "/>



Each process of the system has umask, which is an octal bitmask that clears the permissions for new files and directories created by the process. If a bit is set in Umask, the corresponding permissions in the new file are cleared. Umask clears all groups and other permissions for the newly created file at 077.



Directory permissions: 777 Umask: (0) 022


111 111 111

010 010 = 111 101 101 = 755 (rwx r-x r-x)


File permissions: 666 Umask: (0) 022


110 110 110

010 010 = 644 (rw-r--r--)


Normal User: 775 Umask: (0) 002


111 111 111

010 = 111 111 101 = 775 (rwx rwx r-x)


Privileged Users: 755 Umask: (0) 022


111 111 111

010 010 = 111 101 101 = 755 (rwx r-x r-x)



Note: It is not possible to subtract from the calculation, it should be compared to the corresponding location is 1, the position of 1 becomes 0, in other cases, the value of the position is unchanged.

This article is from the Linux Learning Notes blog, so be sure to keep this source http://10516823.blog.51cto.com/10506823/1721338

Linux File system permissions (ii)

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.