Access Control List - ACL in Linux
by Selva[ Edit ] 2008-04-07 18:32:14
In linux we have a feature called Access Control List which provides us a way to set different file permissions for different users.For example, if want to set rwx for user1 and rw for user2 to the directory called /data, you can do the following steps
First enable ACL by following command:
mount -t ext3 -o acl <device-name> <partition-name>
eg: mount -t ext3 -o acl /dev/sda4 /data ( /dev/sda4 mounted in /data with ACL enabled)
Then set ACL by using the following command:
setfacl -m u

user-name)

permission) (directory or file)
example:
setfacl -m u:user1:rwx /data
setfacl -m u:user2:rw /data
Now rwx is set for user1 and rw is set for user2 for /data directory
You can test ACL by:
getfacl /data