Bureaucrats, cc_docs_admin, cc_staff
2,306
edits
No edit summary |
No edit summary |
||
Line 41: | Line 41: | ||
You can alter these permissions using the command <tt>chmod</tt> in conjunction with the octal notation discussed above, so for example | You can alter these permissions using the command <tt>chmod</tt> in conjunction with the octal notation discussed above, so for example | ||
{{Command|chmod 777 name_of_file}} | {{Command|chmod 777 name_of_file}} | ||
means that everyone on the cluster now has the right to read, write and execute this file. Naturally you can only modify the permissions of a file or directory you own. You can also alter the group by means of the command <tt>chgrp</tt>. | means that everyone on the cluster now has the right to read, write and execute this file. Naturally you can only modify the permissions of a file or directory you own. You can also alter the group by means of the command <tt>chgrp</tt>. | ||
===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_layout | 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 [https://en.wikipedia.org/wiki/Sticky_bit 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 <code>chmod</code>, for example | |||
{{Command|chmod +t <directory name>}} | |||
or if you prefer to use the octal notation discussed above by using the mode 1000, hence | |||
{{Command|chmod 1774 <directory name>}} | |||
to set the sticky bit and <code>rwxrwxr--</code> permissions on the directory. The sticky bit can be unset by the command | |||
{{Command|chmod -t <directory name>}} | |||
or via octal notation, | |||
{{Command|chmod 0774 <directory name>}} | |||
In the context of the project space the directory owner will the PI who sponsors the roles of the students and collaborators. | |||
== Access control lists (ACLs) == <!--T:10--> | == Access control lists (ACLs) == <!--T:10--> |