Translations:Sharing data/13/en

From Alliance Doc
Jump to navigation Jump to search

The sticky bit

When dealing with a shared directory where multiple users have read, write and execute permission, as would be common in the project space for a professor with several active students and collaborators, the issue of ensuring that an individual cannot delete the files or directories of another can arise. For preventing this kind of behaviour, the Unix filesystem developed the concept of the sticky bit by means of which the filesystem permissions for a directory can be restricted so that a file in that directory can only be renamed or deleted by the file's owner or the directory's owner. Without this sticky bit, users with write and execute permission for that directory can rename or delete any files that it may contain even if they are not the file's owner. The sticky bit can be set using the command chmod, for example

Question.png
[name@server ~]$ chmod +t <directory name>

or if you prefer to use the octal notation discussed above by using the mode 1000, hence

Question.png
[name@server ~]$ chmod 1774 <directory name>

to set the sticky bit and rwxrwxr-- permissions on the directory.