Thursday October 13, 2005 Now, I wonder why people do not use ACLs as much as they should. Most Linux distributions do not mount the file system with ACLs support by default. You need to add the option "acl" to the fstab entry in order to enable it, or just remount the partition:
# mount -o remount,acl /On the other hand, with the OpenSolaris filesystem: UFS, you can use ACL from the start, which is something really handy :-)
Let's see some examples on how to use ACLs (works on both: OpenSolaris and Linux):
- Create a test directory and read the ACLs
alo@ferrari:~/tmp$ mkdir test alo@ferrari:~/tmp$ getfacl test # file: test # owner: alo # group: alo user::rwx group::r-x other::r-x- Set a directory default ACL
alo@ferrari:~/tmp$ setfacl -m d:u::rwx,d:g::r-x,d:o:---,d:m:rwx test alo@ferrari:~/tmp$ setfacl -m d:u:www-data:rwx test alo@ferrari:~/tmp$ getfacl test # file: test # owner: alo # group: alo user::rwx group::r-x mask:r-x other:r-x default:user::rwx default:user:www-data:rwx default:group::r-x default:mask:rwx default:other:---Every file created inside the test directory is inheriting the default ACLs we set before:
alo@ferrari:~/tmp$ touch test/file alo@ferrari:~/tmp$ getfacl test/file # file: test/file # owner: alo # group: alo user::rw- user:www-data:rwx group::r-x mask:rw- other:---- Set a single ACL entry for the user dummy
alo@ferrari:~/tmp$ setfacl -m u:dummy:r-- test/file alo@ferrari:~/tmp$ getfacl test/file # file: test/file # owner: alo # group: alo user::rw- user:dummy:r-- user:www-data:rwx group::r-x mask::rwx other::---
Posted by Qwerty on October 13, 2005 at 03:03 PM GMT+00:00 #
Posted by Augur on October 13, 2005 at 04:12 PM GMT+00:00 #
Posted by Sami Dalouche on January 15, 2006 at 10:28 PM GMT+00:00 #