How can I give several users write access to a directory

In general please do use a project group accordingly and follow Data Sharing instruction.

A quick-and-dirty instruction on how to acomplish sharing of data on a filesystem which understands POSIX ACLs follows.

This trick can be performed with the commands setfacl and getfacl (ACL means Access Control List) when the filesystem supports POSIX ACLs. They both have a manpage. Since the concepts of using them is not that simple, you might want to look at the following example.

User tanja wants to setup a directory /scratch/community which she and her friend andrea can access but which is closed to all other users.

She creates a file myacls with the content:

# basic permissions for /scratch/community
user::rwx               # the owner of the directory has read write execute access
group::---              # group has no access
other:---               # neither has all the rest of the world
# acl for ~/community
user:tanja:rwx          # the same for tanja
user:andrea:rwx         # and andrea
mask:rwx                # the highest access privilidge one can get is read write execute
# when new files are created within /scratch/community, they get the following acl
default:user::rwx       # the owner of the new file has read/write/execute access
default:user:tanja:rwx  # tanja will have read/write/execute access to all the new files
default:user:andrea:rwx # and so does andrea
default:group::---      # the group has no access
default:mask:rwx        # the highest access will be read/write/execute
default:other:---        # others have no access

Now she executes setfacl -R --set-file=myacls /scratch/community to apply the new permissions to /scratch/community. With getfacl /scratch/community she can check that everything worked fine.

Please note that the quota rules still do apply here.

In addition, the default entries only apply on directories, for files there are no default ACLs.


FAQ/GiveWriteAccess (last edited 2020-09-07 14:00:48 by bonaccos)