Sharing directories

From LWP-Wiki
Revision as of 15:51, 17 October 2022 by Heiko (talk | contribs)
Jump to navigation Jump to search

If you need to share a directory between a number of people, you can use part of your home directory.
You can also ask for a separate, appropriately-named, directory outside of your homedir, of which you will be the owner. More information on how to do that can be found here.
You can grant others access by using Access Control Lists, ACLs from here on.

How to use NFSv4 ACLs

You can find a detailed manual here.
On the command-line you can give the following command to get more abbreviated usage information and some examples:

 info nfs4_setfacl

Some examples of more commonly used commands

To allow someone read access to a file or directory:

 nfs4_setfacl -a A::<username>@rug.nl:RX <dir/file>

Note: Use upper case RWX instead of lower case.

It is possible to set 'default' ACLs. New files and/or sub-directories can automatically inherit these ACLs.
To have new sub-directories inherit the ACL of it's parent:

 nfs4_setfacl -a A:d:<username>@rug.nl:RX <dir>

And to have new files inherit the ACL:

 nfs4_setfacl -a A:f:<username>@rug.nl:R <dir>

The ACLs can also be edited by using the editor command:

 nfs4_editfacl <dir/file>

Note: Altough you'll see different permission options, you can just use RWX, this gets translated for you automatically when you save your edit.