Using ACLs to set fine grain file permissions

I found this trick and it's almost too good to be true. I have a netware background and used to really good premission control, and Linux basically really sucks - unltil now.

Just discovered Access Control Lists (ACLs) and now I can set the permissions I want.

Ever have the problem were the user and apache need read/write access but you didn't want to do bizzare group tricks or just give them 777 perms just to get it working. Now you don't have to. Just lock i down with 700 perms and then:

setfacl -R -m u:apache:rwx /directory
setfacl -R -d u:apache:rwx /directory

This adds apache rights but not anyone else.

Depending on your file system you'll have to mess with tune2fs and/or mount options to get it to be ACL ready.

Anyhow - thought I'd share this with everyone.

 

 

 

 

Top