Ubuntu ACL Access Control Lists

This is post is now quite old and the the information it contains may be out of date or innacurate.

If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub

If you are working in Linux and need to set some more complex permissions than the straight user, group everyone RWX style, then you can.

Working in Ubuntu, you need to first of all install ACL


sudo apt-get install acl

Now before you can use ACL, you need to enable it on whichever volumes you want to use it on. To do this you have to edit your fstab (which if you do it wrong can cause problems so make sure you back it up!)

In the options column of the fstab for the volume you are working with, you need to add acl, eg:


/dev/mapper/server-root /               ext4    errors=remount-ro 0 

becomes


/dev/mapper/server-root /               ext4    acl,errors=remount-ro 0 

Now you need to remount


mount -o remount /

Now you need to check acl is working:


mount | grep acl

you should see a line with acl in there

Now to recursively set an ACL for a particular user giving full access on a folder structure, use this command:


setfacl -Rm u:user:rwX,d:u:user:rwX /path/to/folder

To fully understand ACL, hit the man pages


man acl