Linux Setfacl ACL examples and setting them for files

November 2, 2006 by Administrator Leave a reply »

From http://www.linuxcommand.org/man_pages/setfacl1.html

#####Granting an additional user read access

$ setfacl -m u:lisa:r file

#####Revoking write access from all groups and all named users
(using the effective rights mask)

$ setfacl -m m::rx file

#####Removing a named group entry from a file’s ACL

$ setfacl -x g:staff file

#####Copying the ACL of one file to another
Methond 1 (did not work in my cygwin install):

$ getfacl file1 | setfacl --set-file=- file2

Method 2:

$ getfacl file1 > acls.txt
$ setfacl -f acls.txt file2

#####Copying the access ACL into the Default ACL

getfacl --access dir | setfacl -d -M- dir
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit
Advertisement:

One Response

  1. rymo says:

    I was able to use Method 1 in cygwin after slight modification for setfacl v1.13:

    `getfacl file1 | setfacl -f – file2`

Leave a Reply


Mochabomb is Digg proof thanks to caching by WP Super Cache