Samba permisions when copying files to file share

permissionsserver-message-block

Maintainign a ubuntu server for a client where they use several file shares through smb.

Fileshares have permisions to user groups and are set to 0770

Lately I get a lot of complaints from users who can't access files and it's always the same, for some reason the permissions of certain files /folders have changed …

Already using create mask, but maybe I should put "map archive = no" in the default? Never used this in smb config so not sure what it does?

This is my share config in smb.conf

[file-share-name]
        writeable = yes
        path = /home/file-share
        write list = user1,user2,user3,@usergroup
        force directory mode = 770
        force group = usergroup
        force create mode = 770
        comment = usergroup
        valid users = user1,user2,user3,@usergroup
        user = user1,user2,user3,@usergroup
        create mode = 770
        browsable = yes
        directory mode = 770

Would adding a "map archive = no" avoid having to reset file permissions the whole time?

Best Answer

all you should need for samba is this

[sharename]
        create mask = 660
        directory mask = 770
        inherit acls = Yes
        path = /wherever/yourfolder
        read only = No

When a given user from a windows client does create new folder it should have permissions drwxrwx--- and when doing create new text file that new file should be -rw-rw----. If that does not happen, then to troubleshoot set the masks to 666 and 777 respectively or remove those two lines and see what happens after creating a new folder and new text file.

Obviously if you use masks 660 and 770 then be sure a given user has the correct group permissions. By default all user accounts are typically in the users group, and that is their primary group, anything created by them will have the group permissions of users and it all should work seamlessly.