How to automatically apply permissions to files added to a shared folder

I have a shared folder setup on a Mac Mini Server. It has permissions for our company group to read/write. When a mac user adds a file to the shared folder, it inherits the permissions of the folder and everyone can access it (yay!).

However, when a PC user adds a file to the folder, it insists on applying its own permissions to the file, not allowing the other users in the group to access it. I have to manually go into the server and apply the folder permissions to the new files added.

How can I have the files added by the PC users automatically inherit the permissions of the parent share folder?


I believe the way to resolve this is to set up ACL inheritance permissions on the parent folder. More about this here.

Firstly enable ACL permissions for SMB shares with the following command.

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AclsEnabled -bool YES

Then set up inheritance permissions on the parent holder with the following command. This should recursively go through your share and apply the relevant permissions.

sudo chmod -R +a "group:REPLACE_WITH_YOURGROUP_NAME:allow readattr,writeattr,readextattr,writeextattr,readsecurity,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" REPLACE_WITH_PATH_TO_PARENT_SHARED_FOLDER

To be safe I'd recommend creating a test share to try the chmod command before applying it to your company's share. Then once you are sure you get the right results apply it to the live/production share.