I am trying create a samba share which is readable by anyone (guest/anonymous access) but only writeable by a particular system group. However it is not writeable to anyone.

I have created a new directory and set permissions as follows:

sudo mkdir /mnt/testshare
sudo chgrp testgroup /mnt/testshare
sudo chmod g+s /mnt/testshare
sudo chmod g+wrx /mnt/testshare

After which that directory is listed as:

drwxrwsr-x 3 root testgroup 4096 Apr 24 07:05 testshare

I have created an entry in smb.conf:

    path = /mnt/testshare
    write list = @testgroup
    create mask = 0660
    force directory mode = 02770
    guest ok = Yes

And restarted my samba server.

After doing this I am able to read all the files in that directory as a guest or when I'm logged in, but I'm unable to delete or modify files even when I am logged in as a user in that group (testgroup).

I have checked that I am able to create files in that directory as the same user by ssh'ing in, so the system permissions are ok.

My question

How should I configure samba to allow this?

Output of smbd --version is Version 4.2.10-Debian


The solution was to run smbpasswd -a $user for the users in question.

I also changed

create mask = 0660
force directory mode = 02770


create mask = 0665
force directory mode = 02775

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.