Need help with samba "create mask"
Posted on 2011-10-12
I have an ubuntu machine running a samba server to share my "/var/www" folder.
The umask for all users on the linux machine is the default, whatever comes out of the box with Ubuntu 11.04 Server Edition.
I need to set it up so that when users create files via the samba share (e.g. if a windows or a mac desktop connect via samba and create a file), that the file has the following permissions:
So basically, what I want is new files to look like this:
-rw-rw-r-- 1 john john 0 2011-10-12 17:21 newfile.txt
To accomplish this, I used the "create mask" and "force create mode" parameters in smb.conf:
path = /var/www
writeable = yes
; browseable = yes
valid users = john, jane
create mask = 0775
directory mask = 0775
force directory mode = 0775
force create mode = 0775
Obviously my understanding of umasks is not correct, because when I create a file via samba, I get the following permissions:
-rwxr-xr-x 1 john john 0 2011-10-12 17:18 asdf.txt
Completely wrong. I have execute permissions where I actually wanted "write" permission, and the "other" group has too much permission.
So i tried something different:
create mask = 0777
directory mask = 0777
force directory mode = 0777
force create mode = 0777
And the result:
-rwxr-xrwx 1 john john 0 2011-10-12 17:21 asdf.txt
That's weird too - the OTHER permission got set, but not GROUP.
How do I need to modify the masks above so that I get the desired permissions?