Access Control List - ACL in Linux - Linux Views : 668
Tagged in : Linux
Send mail vote down 0 vote down 0
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 uSad
user-name)Sad
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
By - Selva, On - 2008-04-07




    Login to add Comments .