4

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?

user9517
  • 114,104
  • 20
  • 206
  • 289
tkahn
  • 141
  • 1
  • 4
  • Which Samba version are you using? – quanta Sep 05 '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 05 '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 06 '11 at 11:15
  • snap: Thanks! One thing I could try is change it to 770 on create mask and create mode. – tkahn Sep 06 '11 at 11:16

1 Answers1

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

and try again.

quanta
  • 50,327
  • 19
  • 152
  • 213
  • Sorry - no difference. I suspect that there is some configuration or quirk in FreeNAS that I've overlooked? – tkahn Sep 07 '11 at 07:23