I've been searching for while to try to understand the following mask/mode fields for creating files/folders in Samba shares:

create mask
force create mode
directory mask
force directory mode

But I've failed... I'm looking into changing the files/folders to specific permissions (when files/folders are created on the Samba shares) but the combination of the mask and mode is complicating things.

Here's what I'm after for file and directory creation permissions:

File: -rw-rw-r-- (664)

Directory: drwxrwxr-x (775)

What do I have to set on the above 4 Samba configuration fields to achieve this?

2 Answers 2


I still don't quite understand how they work but after testing a little bit more I found that the following actually worked for what I wanted:

create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775

I'll us this for now... Let me know if you have an alternative that makes more sense.


First set unix permission for users,better if use acl for example you want to share pubblica with permission of 770 only for group "domain users"

in smb.conf

   comment = Dir pubblica
   browseable = yes
   public = yes
   path = /var/pubblica
   writable = yes
   force create mode = 0660
   force directory mode = 0770
   valid users = @"Domain Users"

on linux side

chmod 770 /var/pubblica
setfacl  -m g:"domain users":rwx /var/pubblica
setfacl  -d -m o:---  /var/pubblica

The first acl give to domain users the 777 permission the second deny access read and write to others.

In this case we had a var/pubblica dir only for domain users adapt this to your situation

  • This doesn't answer the question "What do I have to set on the above 4 Samba configuration fields to achieve this?".
    – rfgamaral
    Jun 7, 2015 at 22:14
  • Read the answer,for the permission you will set the unix side with acl and the windows side using smb.conf
    – elbarna
    Jun 7, 2015 at 22:15
  • That's not what I asked.
    – rfgamaral
    Jun 7, 2015 at 22:15
  • Ok sorry probably i don't understand your question
    – elbarna
    Jun 7, 2015 at 22:23
  • I edited the question to try and clarify.
    – rfgamaral
    Jun 7, 2015 at 22:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .