Group Collaboration is an essential part of any system administrator who deals with users. Knowing file and directory permissions will allow you to let users work together. Here, we look at three key features:
setuid This flag is used to allow multiuser access.
setgid This flag is used to allow multigroup access
sticky bit This flag prevents accidental delete by users or groups
For group collaboration, you need two key commands as well:
chmod Changes permissions on files and directories
chown Changes ownership of files and directories
The first feature is setuid, which is set on files at the owner level with chmod command. This allows executables to be run with the privileges of the file’s owner. For example, you create a script that only user01 can be run. You can set the setuid to enable other users to run this command as though they were user01.
Notice that there is an S in place of the x. this shows that this file has the setuid flag set.
Now let’s look at setgid which is similar to setuid but set at the group level instead.
After setgid, all members of Sales group are able to read/write to files within this folder. Also, notice that access to this folder is denied for any one who isn’t a member of the Sales group.
Finally, let’s look at the sticky bit. It’s used to prevent anyone from deleting files, and it’s usually set on directories.
Now other users are not able to delete your files; only you can. This feature might be helpful when you’re sharing files and there are particular files you don’t want other users to delete.
Have fun!