Linux Setfacl Getfacl ACL examples

Some Basic examples of setting permissions to Files.

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:

$ 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
Advertisements

3 thoughts on “Linux Setfacl Getfacl ACL examples

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s