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 have a directory with the following default ACLs:

default:user:phptutor:rwx

However, none of the files/directories in that directory have that default permission (because it was added after they were created).

How can I copy the default ACLs of a parent directory to every folder and file in it?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Use getfacl to get the default permissions from the directory and then pipe the result into setfacl to apply it. Something like this should work:

getfacl -d <directory> | setfacl -R --set-file=- <directory>
share|improve this answer
    
Thanks, Tom! That worked incredibly well! –  hopeseekr Jul 1 '11 at 12:29

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.