Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a new server and wanted to give ACL a shot over the chown:chgrp:chmod style permissions.

The man page for setfacl indicates that the '-R' option can be used to set the ACL recursively on files and directories.

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

If my directory layout looks like this

test/
   subtest/
   subtest.txt

and I execute

setfacl -Rm d:u:foo:rwX test

The ACL takes effect on the 'subtest' directory, but not the subtest.txt file.

I think I can use find + exec to workaround it, but I plan to use this server to train a few other admin and I am wanting to keep it as simple as possible so we don't get hung up on some of the more advanced conventions.

Thanks

share|improve this question
add comment

1 Answer

up vote 21 down vote accepted

Try:

setfacl -Rm u:foo:rwX,d:u:foo:rwX test

to modify the current ACL as well as the default. I believe "d:" only affects the (d)efault ACL of directories and leaves files untouched. Then, if you create a new file in the directory, it inherits the ACL of its parent directory via the default.

share|improve this answer
    
That makes sense even if it feels a bit redundant –  Joe Holloway May 2 '09 at 23:00
    
Does this work for removing access control as well. Perhaps something to the effect of: sudo setfacl -Rx g:gid path –  user105964 Jan 4 '12 at 21:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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