Make samba create files with usable group permissions

I am using Samba as my file server at home and connecting to it from two different users on their own macbook laptops. The Debian server has a share directory in /var/share that either myself or any other user on the system can connect to and create files or directories in. We all want to be able to edit each others files in addition to adding or removing directories and files as well, regardless of who created or owns them.

First, I created a directory in /var/share that is owned by one user, with group of “users”. All users with access to this share are members of the ‘users’ group on the file server.

Below is the config for the /var/share folder, as defined in /etc/samba/smb.conf

These should be obvious what they do if you’re familiar with permission in unix, “inherit permissions = yes” will inherit the permissions from the parent directory. “directory mask” and “create mask” refer to directory permissions and file permissions respectively. The “valid user = @users” refers to any user in the “users” group on the system, which will allow them to access the share.

The “force group = users” will force any directory or file to be owned by “:users”.

You might need to fix your existing files and directories for this to work properly.

This will make every file and directory in /var/share belong to the ‘users’ group:

This wlll make every file 664 (user+group writable):

This will make every directoy 775 (user + group writable):