SETFACL(1)

NAME
setfacl - Modify file and directory access control lists (ACLs)

SYNOPSIS

setfacl [-r] {-f ACL_FILE | -s acl_entries} FILE...
setfacl [-r] {-b|[-d acl_entries] [-m acl_entries]} FILE...

OPTIONS

      -b, --remove-all remove all extended ACL entries
      -d, --delete     delete one or more specified ACL entries
      -f, --file       set ACL entries for FILE to ACL entries read
                       from a ACL_FILE
      -k, --remove-default
                       remove all default ACL entries
      -m, --modify     modify one or more specified ACL entries
      -r, --replace    replace mask entry with maximum permissions
                       needed for the file group class
      -s, --substitute substitute specified ACL entries for the
                       ACL of FILE
      -h, --help       output usage information and exit
      -V, --version    output version information and exit
    At least one of (-b, -d, -f, -k, -m, -s) must be specified

DESCRIPTION

For each file given as parameter, setfacl will either replace its complete ACL (-s, -f), or it will add, modify, or delete ACL entries. For more information on Cygwin and Windows ACLs, see see the section called “POSIX accounts, permission, and security” in the Cygwin User's Guide.

Acl_entries are one or more comma-separated ACL entries from the following list:

             u[ser]::perm
             u[ser]:uid:perm
             g[roup]::perm
             g[roup]:gid:perm
             m[ask]::perm
             o[ther]::perm

Default entries are like the above with the additional default identifier. For example:

             d[efault]:u[ser]:uid:perm

perm is either a 3-char permissions string in the form "rwx" with the character '-' for no permission or it is the octal representation of the permissions, a value from 0 (equivalent to "---") to 7 ("rwx"). uid is a user name or a numerical uid. gid is a group name or a numerical gid.

The following options are supported:

-b Remove all extended ACL entries. The base ACL entries of the owner, group and others are retained.

-d Delete one or more specified entries from the file's ACL. The owner, group and others entries must not be deleted. Acl_entries to be deleted should be specified without permissions, as in the following list:

             u[ser]:uid[:]
             g[roup]:gid[:]
             m[ask][:]
             d[efault]:u[ser][:uid]
             d[efault]:g[roup][:gid]
             d[efault]:m[ask][:]
             d[efault]:o[ther][:]

-f Take the Acl_entries from ACL_FILE one per line. Whitespace characters are ignored, and the character "#" may be used to start a comment. The special filename "-" indicates reading from stdin. Note that you can use this with getfacl and setfacl to copy ACLs from one file to another:

    $ getfacl source_file | setfacl -f - target_file

Required entries are: one user entry for the owner of the file, one group entry for the group of the file, and one other entry.

If additional user and group entries are given: a mask entry for the file group class of the file, and no duplicate user or group entries with the same uid/gid.

If it is a directory: one default user entry for the owner of the file, one default group entry for the group of the file, one default mask entry for the file group class, and one default other entry.

-k Remove all default ACL entries. If no default ACL entries exist, no warnings are issued.

-m Add or modify one or more specified ACL entries. Acl_entries is a comma-separated list of entries from the same list as above.

-r Causes the permissions specified in the mask entry to be ignored and replaced by the maximum permissions needed for the file group class.

-s Like -f, but substitute the file's ACL with Acl_entries specified in a comma-separated list on the command line.

While the -d and -m options may be used in the same command, the -f and -s options may be used only exclusively.

Directories may contain default ACL entries. Files created in a directory that contains default ACL entries will have permissions according to the combination of the current umask, the explicit permissions requested and the default ACL entries

COPYRIGHT

Copyright © 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.

Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.