Sharing directories: Difference between revisions

From LWP-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
To allow someone read access to a file or directory:
To allow someone read access to a file or directory:
   nfs4_setfacl -a A::'''<username>'''@rug.nl:RX '''<dir/file>'''
   nfs4_setfacl -a A::'''<username>'''@rug.nl:RX '''<dir/file>'''
''Note! Use upper case '''RWX''' instead of lower case.''
''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.<br>
It is possible to set 'default' ACLs. New files and/or sub-directories can automatically inherit these ACLs.<br>
Line 22: Line 22:
The ACLs can also be edited by using the editor command:
The ACLs can also be edited by using the editor command:
   nfs4_editfacl '''<dir/file>'''
   nfs4_editfacl '''<dir/file>'''
Altough you'll see different permission options, you can just use '''RWX''', this gets translated for you automatically when you save your edit.
''Note: Altough you'll see different permission options, you can just use '''RWX''', this gets translated for you automatically when you save your edit.''

Revision as of 13:51, 9 April 2021

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.