Samba – Create files/dirs as group

permissionssamba

Say I have a protected directory called Corp that only members of the unix group Corp can access and its mostly working with:

read list = @corp

write list = @corp

create mask = 0770

Problem is, when a user creates a file there, its setting the user and group ownership to them, e.g. when user1 creates foo1, it has the permissions 770 for user1:user1 and user2 can't access or edit the file.

Is there a way to make it user1:corp from samba settings or should I change the create mask to 0777 (which I've enabled temporarily after doing a chgrp -R corp on the shared directory)?

Users have SSH access to the server so the folder /svr/corp itself needs to be restricted, right now its set to 770.

Best Answer

You can use the force group directive in your share definition to force that a particular group be used for all files on that share.