How to modify permissions on a Samba Share directory
You must have the acl
dependency installed and your filesystem has to support extended
permissions.
Example
u – user
d – default
g – group/groups
rwx – read, write, execute
[] – Special Character – E.g.: /mnt/shared/name\ with\ space
e.g.: d:u:[r][w][x] or
d:u:[SHORTDOMAINNAME@NAME]:[r][w][x]
default:user:[r][w][x]
mkdir /mnt/shared/folder
getfacl /mnt/shared/folder
# file: mnt/shared/folder
# owner: root
# group: root
user::---
group::---
mask::rwx
other::---
default:user::---
default:group::---
default:mask::rwx
default:other::---
If we want to set recursive permissions:
$ setfacl -Rm u:REALM+dblanque:rwx /mnt/shared/folder
$ setfacl -Rm d:u:REALM+dblanque:rwx /mnt/shared/folder
If we don’t want to use recursive permissions we do the same as above but with the following:
$ setfacl -m instead of setfacl -Rm
$ getfacl /mnt/shared/folder
# file: mnt/shared/folder
# owner: root
# group: root
user::---
user:REALM@dblanque:rwx
group::---
mask::rwx
other::---
default:user::---
default:REALM@dblanque:rwx
default:group::---
default:mask::rwx
default:other::---