Sticky bit permissions under Linux

Source: Internet
Author: User

1, why should have sticky bit?

Linux has a directory to hold temporary files,/tmp (similar to the temp directory in Windows), each user generated temporary files are stored in this directory, that is, each user should have write permission to the/tmp directory (otherwise cannot copy the makefile), which creates a problem, for example, A classmate in the/tmp directory created a file, B classmates look at the uncomfortable can be deleted, how to control?
In fact, this situation will never happen because the/TMP directory has a special permission tag:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/83/18/wKiom1dql9ORBviSAAAsAzxLpmM643.png "title=" screen Shot 2016-06-22 at 21.50.35.png "alt=" Wkiom1dql9orbvisaaasazxlpmm643.png "/>

See that rwx permission last "T" no, that magical "T" is sticky bit t (some of the information is also known as sticky bit), is the third of Linux special permissions (the other two is setuid and setgid), defined as: The permissions of 777 of the directory set sticky bit t, With Write permissions each user can create files in the directory, except that each user can only delete files that they are the owner, that is, they can only delete files that they have created.

2, how to set the sticky bit?

chmod +t/-t Directory Name

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/83/18/wKiom1dqmWDTmn1yAAAP3deApO0609.png "title=" 2016-06-22 21-56-23 screen. png "alt=" Wkiom1dqmwdtmn1yaaap3deapo0609.png "/>



This article from "Momo is spicy moe" blog, please be sure to keep this source http://momo462.blog.51cto.com/10138434/1791926

Sticky bit permissions under Linux

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.