1

I want to reset the ACLs on a directory tree so that the root directory ACL replaces the ACLs on all files and folders below it. How best can I achieve this?

Edit: Is this question poorly worded? Can someone give me some feedback even if you don't know the answer?

2 Answers 2

2

You just need to find out the ACL by running an ls -V on the directory (in this example, I'm running it on the root directory from /:

drwx------   4 root     root          10 Feb 25  2011 root
             owner@:rwxp--aARWcCos:-------:allow
             group@:------a-R-c--s:-------:allow
          everyone@:------a-R-c--s:-------:allow

You can then run a chmod -R A=<<INSERT ACL HERE>> * on the directory, where <<INSERT ACL HERE>> is replaced with the acl as listed in the ls command.

In this case, I'd cd root and then issue chmod -R A=owner@:rwxp--aARWcCos:-------:allow\ group@:------a-R-c--s:-------:allow\ everyone@:------a-R-c--s:-------:allow *

This usually works for me.

2
  • ah cool, that makes sense, so simple. There should be nothing wrong with setting the 'r' and 'd' inherit flags on with this operation?
    – Matt
    Nov 9, 2011 at 0:04
  • I shouldn't think so.
    – growse
    Nov 9, 2011 at 0:33
1

Occasionally, you might want to consider to assign different permissions to Dir and Files, for instance 2755 and 0644, in this case

$ cd 

$ find . -t d -exec chmod 2755 {} \; # update ACL on dirs

$ find . -t f -exec chmod 0644 {} \; # update ACL on files

OB

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .