File permission mask/mode settings for Samba on FreeNAS?

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

and try again.

Share:
5,709

Related videos on Youtube

Coolar
Author by

Coolar

Team Leader and Front End Developer working at the digital agency Limetta in Stockholm, Sweden. Limetta Personal webpage

Updated on September 18, 2022

Comments

  • Coolar
    Coolar almost 2 years

    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?

    • Admin
      Admin almost 13 years
      Which Samba version are you using?
    • Admin
      Admin almost 13 years
      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.
    • Admin
      Admin almost 13 years
      quanta: I'm using FreeNAS version 0.7.2. In this I think version 3.5.5 of Samba is included.
    • Admin
      Admin almost 13 years
      snap: Thanks! One thing I could try is change it to 770 on create mask and create mode.
  • Coolar
    Coolar almost 13 years
    Sorry - no difference. I suspect that there is some configuration or quirk in FreeNAS that I've overlooked?