Creating a samba share where everyone has write access

Solution 1:

In smb.conf, in the shared directory section, place:

create mask = 0644
directory mask = 2777

Initially, use g+s permission on all directories and chown them for the sambashare group. The s bit will keep the group of the files created the same as the directory group (and 2777 will take care of the s bit on the new directories).

Solution 2:

To allow everyone from the group SAMBASHARE to access the shares add the following to the [global] directive:

create mode = 664
workgroup = SAMBASHARE
security = user
usershare allow guests = yes

To export /data/shared you have to add the following at the end of the file:

[data]
comment = shared
path = /data/shared
guest ok = yes
read only = no
public = yes
writable = yes

That should work for you, but I strongly recommend to gather some more information.

Solution 3:

After stuggling through this same problem and seeing a lot of unhelpful posts that "solved" this problem, I finally traced my problem down to one line in the specific share section I wanted to be group-writeable:

 force directory mode = 2770

The "2" is MANDATORY, and the Samba server won't make newly created directories group-writeable without this (i.e. 0770 is NOT sufficient). I'm using the Samba daemon in Ubuntu 12.04.01, with the standard windows client to create the directory.

It would be nice if this was documented in the smb.conf man page.....

Just for clarification, the following does NOT work for me (even with "unix extensions = off" -- the directories are created with permission 0750):

[MyShare]
   writeable = yes
   force group = somegroup
   ...
   directory mask = 0770
   directory security mask = 0770
   force directory mode = 0770
   force directory security mode = 0770