I'm currently working on the Samba settings on a FreeNAS server. When any user creates a file or a folder on the server I want the file or folder to get the following RWX permissions:

Folders: drwxrws---
Files: -rwxrws---

To set the permissions like this manually I use chmod 2770 which works great. But I want this to happen automatically and therefore I've added the following lines to smb.conf:

create mask = 2770
directory mask = 2770
force create mode = 2770
force directory mode = 2770

But when I test by creating a file in one of the folders it get's these permissions:

Folder: drwxrwx
File: -rwxrw----

What am I overlooking or doing wrong? Is the order of the lines relevant? Does the setgid digit (the 2 in 2770) mess things up?

link|improve this question
Which Samba version are you using? – quanta Sep 5 '11 at 15:43
1  
Just a note: Unless you have a very special situation you probably do not want your files to have the set-gid bit set. For the directories it makes sense but not for the normal files. – snap Sep 5 '11 at 17:36
quanta: I'm using FreeNAS version 0.7.2. In this I think version 3.5.5 of Samba is included. – tkahn Sep 6 '11 at 11:15
snap: Thanks! One thing I could try is change it to 770 on create mask and create mode. – tkahn Sep 6 '11 at 11:16
feedback

1 Answer

  1. chmod g+s for parent directory
  2. set inherit permissions = yes

and try again.

link|improve this answer
I will try this and get back to you! Thanks! – tkahn Sep 6 '11 at 11:26
Sorry - no difference. I suspect that there is some configuration or quirk in FreeNAS that I've overlooked? – tkahn Sep 7 '11 at 7:23
feedback

Your Answer

 
or
required, but never shown

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