Our blog

 

Ubuntu ACL Access Control Lists

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

CODE:
  1. 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:

CODE:
  1. /dev/mapper/server-root /               ext4    errors=remount-ro 0

becomes

CODE:
  1. /dev/mapper/server-root /               ext4    acl,errors=remount-ro 0

Now you need to remount

CODE:
  1. mount -o remount /

Now you need to check acl is working:

CODE:
  1. 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:

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

To fully understand ACL, hit the man pages

CODE:
  1. man acl

More Reading:

 

Leave a Reply