I have setup a Samba share on Ubuntu 12.04 for our finance team, and they access it via Windows 7 and Mac OS X. They mount the share using their LDAP credentials. All of our LDAP users have "employees" as their primary group, and the finance team belongs to a secondary group named "finance".
When any of the finance team members create a folder within the Samba share, the folder's group defaults to "employees". How can I force all files and folders created on the share to have the group set to "finance"?
For share foo, with path /bar/foo, the following in your
smb.conf
file should do it:The mode statements are to ensure that all directories and files created via samba are group-writeable: it's no good just being group-owned by the right group if that group has no privileges to do anything.
You can use setfacl for this purpose. Man setfacl here. Setfacl allows you to set ownerships and rights different than default ones. Here is a similar question which can also helps you: