Friday, 8 July 2011

Linux - Set ACL for user on directory

If you want to set an acl for a specific user/group/other on linux you can issue the following:
$ setfacl -m <type>:<name>:<permission> <file|directory name>
So for example if wishing to grant Bob read, write, execute permissions on directory dir you would issue the following:
$ setfacl -m u:bob:rwx dir
To check Bob's permissions you can use getfacl with the omit-headers flag which hides the first three lines showing the name, owner and group:
$ getfacl --omit-header dir
user::rwx
user:bob:rwx
group::r-x
mask::rwx
other::---

No comments:

Post a Comment

Please feel free to leave a comment