In this article, I will show you how to setup ACL with Samba in Centos 6.

First you need to mount the filesystem with the acl option

To remount your current partition

# mount -o remount -o acl /dev/md0 /raid5

To mount on boot

# vi /etc/fstab

add acl option like this

/dev/md0 /raid5 ext3 acl 1 2

# groupadd samba_read
# setfacl -R -m g:samba_read:rx /raid5/server
# usermod -G samba_read andy

This creates a group “samba_read” which has read-only permission to the the directory /raid5/server. Then I add myself to the group.

# groupadd samba_write
# setfacl -R -m g:samba_write:rwx /raid5/server
# usermod -G samba_write andy

This creates a group “samba_write” which has read-write permission.

Notes:

  • Samba supports ACL by default
  • you can also edit /etc/group to assign/delete the groups to/from users.
  • make sure you are not using force user = root on your shared directory. This will force everyone to have root access no matter what ACL permissions you have set.

Post Navigation