Skip to main content

Linux Multiple Users Permission Read / Write

ACL provides a more flexible way to control the file permission, e.g. allow multiple users like www-data and ftpuser to read/write the same directory.

1. Install ACL:
CODE
aptitude install acl


2. Edit /etc/fstab and add the "acl" option, e.g.:
CODE
/dev/sda3 / ext3 defaults,errors=remount-ro,acl 0 1


3. Remount the partition:
CODE
mount -o remount /


4. Check to make sure that it is mounted with acl:
CODE
mount | grep acl


5. Add users to ACL:
CODE
setfacl -R -m u:www-data:rwx /path/to/directory
setfacl -R -m u:ftpuser:rwx /path/to/directory


It will be very slow if there are many sub-directories. So be specific, e.g. /home/www/http_www.cubbaalumni.org/public_html/file/

6. Check ACL:
CODE
getfacl /path/to/directory

Comments