Differences between revisions 2 and 3
Revision 2 as of 2012-12-05 13:58:48
Size: 1858
Editor: pmeier
Comment:
Revision 3 as of 2013-05-31 09:01:34
Size: 1882
Editor: bonaccos
Comment:
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:
----
[[CategoryLXBS]]

How can I give several users write access to a directory of mine?

This trick can be performed with the commands setfacl and getfacl (ACL means Access Control List). 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 ~/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 ~/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 ~/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 ~/community to apply the new permissions to ~/community. With getfacl ~/community she can check that everything worked fine.

Please note that the quota rules still do apply here. If andrea has no quota on the disk where tanjas home is, she will still not be able to write to this directory.

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


CategoryLXBS

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