2014年8月27日 星期三

Set child folder's default permission the same as parenet folder's permission

Use ACL module and set sgid

1. sudo apt-get install acl
2. Modify /etc/fstab set the option "acl" to the mounted file system
    ex. /dev/sda1 / ext4 errors=remount-ro,acl 0 1
3. Remount the mount point
    >> sudo mount -o remount /
4. Set the ACL for the folder
    >> setfacl -dm u::rwx,g::rwx,o::r /home/folder/path
5. Set sgid for the folder
    >> chmod g+s /home/folder/path
6. It's OK