Three special permissions for Linux files suid, SGID, STICKY

Source: Internet
Author: User

Three special file system formats:

1>. SUID

Action object: Can only function in the binary executable file, that is, it runs itself is a process.

Effect: A binary file without suid permissions can be executed depending on whether the current user has permission to execute the file, and after execution, the owner of the process is also the current system user. After being serviced suid, when the file is run, the owner of the process is not the current user of the system, but the owner of the file.

Command: chmod u+s file


2>. SGID

Sgid permissions are divided into two cases, which are acting on the file and acting on the directory.

A>. Action on a file, once a file is given permission to Sgid, regardless of whether the current user has execute permissions, the user runs the program and automatically inherits the permissions of the group to which the program belongs.

Command: chmod g+s file

B>. Role in the directory, the effect is completely different from the file, the new file in the directory or the directory of the group will automatically inherit the directory belongs to the group.

Command: chmod g+s directory


3>. Sticky once a file has been given the Sticky bit, only the owner or root of the file can delete the file.

Sticky is the role in the directory, when the directory is set to sticky bit, the directory can only be deleted by the root user and the file owner, the other users do not have permission to delete the file.

Command format:

chmod o+t DIR.

chmod o-t DIR.


Three special permissions for Linux files suid, SGID, STICKY

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.