Set Default Directory Permissions in Using ACLs

I’ve only tested this on RHEL/CentOS/Scientific Linux but should work on any system running Linux acl.

ACL’s are useful for providing more granular file and directory access permissions as a supplement to the standard Unix user/group permissions.

Let’s say you want the user ‘funboy’ to have full control over the /disco directory on your system, and you want that to be the case for new files created in /disco as well.  The kicker is that the /disco directory is owned by root and you don’t want to add funboy to the root group.  Instead use acl’s!

You may need to install it first:

vmhacks.com ]# yum install acl

Then run this:

vmhacks.com ]# setfacl -R -m u:funboy:rwx,d:u:funboy:rwx /disco

Now run:

vmhacks.com ]# ls -l

You’ll see a little “+” which indicates you’re using an ACL.  Note that’s a plus sign, not the letter “t” which would mean the sticky bit has been set.

Run this if you want to see the current ACL stuff:

vmhacks.com ]# getfacl /disco

Mm.,