We are moving our web files from AFS to a local volume with the acl flag set. We use extended ACLs for our permissions so users can edit different parts of our websites. In AFS, when you create a new file it inherits its parent's permissions.

How do we make it so that when users create new files in their web directories, those files inherit the parent's facl? (Which includes www-data) If it helps, we run Gentoo Linux.

  • what filesystem are you using in your local volume?
    – c4f4t0r
    Nov 25, 2013 at 23:15
  • ext4 (with the acl flag in fstab)
    – Vacation9
    Nov 25, 2013 at 23:22
  • if you check my answer you can see a link some example
    – c4f4t0r
    Nov 25, 2013 at 23:24

1 Answer 1


On Linux, many filesystems support posix acl.

If you have many directories and you want to apply the acls on subdirs

 -R, --recursive
       Apply operations to all files and directories recursively. This option cannot be mixed with ‘--restore’.

But if you want the acl are apply on files and directories on creation time, you need the defaults acls on directory

 setfacl -d -m user:user01:rwx dir
  • We are using posix/extended acls. What we want to do is have these apply recursively, as normal acls do, upon creation of a new file in that directory.
    – Vacation9
    Nov 25, 2013 at 23:27
  • Alright, if new directories are created in the directory with default acls set will they also inherit those defaults? Or will the defaults apply at any depth?
    – Vacation9
    Nov 25, 2013 at 23:49
  • 1
    yes, i tried now and i can tell it work, if you set the default acl on a directory, the subdir inherit the acl from parent dir and default too
    – c4f4t0r
    Nov 25, 2013 at 23:53
  • 1
    Note that this will work for new or copied files, but not for moved files. Moving keeps the existing ACLs, even if the destination has "default" ACLs set on it... Jan 28, 2019 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.