Creating a samba share where everyone has write access

11

3

I have an Ubuntu server in my house running samba. I'm trying to set up a samba share where everyone has read and write access.

I have all the users in a 'sambashare' unix group and want to offer the directory /data/shared to all members of the 'sambashare' group for read and write access.

Ideally if a user creates a file in there using samba it should have the permissions 0644 and be owned by username:sambashare

I can't work out what to put in the smb.conf file to make this work, or what unix permissions to give the /data/shared folder.

Piku

Posted 2011-04-24T12:40:00.747

Reputation: 557

Answers

7

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).

laurent

Posted 2011-04-24T12:40:00.747

Reputation: 4 166

Hello I have tried this but it is not working! Can you have a look at my question

– maxisme – 2015-03-14T14:37:25.957

4

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

create mode = 664
workgroup = SAMBASHARE
security = SHARE
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.

binfalse

Posted 2011-04-24T12:40:00.747

Reputation: 1 426

public is a sinonym for guest ok as indicated on https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#GUESTONLY – Rafael Campos Nunes – 2019-12-03T18:55:04.377

1

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

user192757

Posted 2011-04-24T12:40:00.747

Reputation: 11