share
Server FaultHandling file permissions in Linux with ACL
[+2] [3] Pablo Santa Cruz
[2009-05-20 14:34:57]
[ linux acl ]
[ http://serverfault.com/questions/10371/handling-file-permissions-in-linux-with-acl ]

How can I get ACL for file permission to work in Linux?

I don't care kernel version or distribution. I will do a clean install anyway. Is there a KERNEL/FS supported ACL? If I choose Linux, am I stuck with UGO approach to file permissions?

Thanks.

[+6] [2009-05-20 16:23:55] Zoredache [ACCEPTED]

In addition to installing the packages and hving a kernel that supports it you must mount the filesystem with the acl option. ACLs are supported in most of the popular filesystems like ext3, ext2, jfs, and reiser.

Here are a couple links that may help you get started.

[1] http://linux.die.net/man/5/acl
[2] http://linux.die.net/man/1/setfacl
[3] http://linux.die.net/man/1/getfacl
[4] http://www.vanemery.com/Linux/ACL/linux-acl.html
[5] http://www.suse.de/~agruen/acl/linux-acls/online/

1
[+1] [2009-05-20 14:46:13] innaM

Simply install the relevant package. On Debian-based distros, the package is called " acl [1]". I'm sure other distros ship it as well.

You'll get getfacl and setfacl from that package.

[1] http://packages.debian.org/unstable/utils/acl

Do I need special kernel support? Do I need a specific file system? - Pablo Santa Cruz
2
[+1] [2011-06-04 04:22:59] Interarticle

Three steps:

  1. Install acl, by running 'sudo apt-get install acl' (works on ubuntu and debian)

  2. Enable file system option acl, by remounting the mount point containing the files needed to be managed. For example, if the file in question is under /, run 'sudo mount -o remount,acl /', then run 'mount' to see if the option has been enabled. If not, then acl is either not supported by your kernel or the filesystem. You can add the option to fstab after testing.

  3. Edit the acl. For example: 'setfacl -m username:r-x'

Hope this will help starters.


3