I have a directory with permission 755, shared using samba. I have a samba user abc:abc which is also the owner of that directory. Windows samba client was denied write to the directory. When I chmod the directory to 775, the windows client is now able to write in it.

From the above, I have the conclusion that directory is checking samba user's group permission even though said user is the owner of the directory. Why is it?

Original details:

Apologize if I have any typo, I am typing it from air.

drwxr-xr-x abc abc 4096 DirectoryName

I have smb.conf sharing it.

[something] comment = something browseable = yes path = /something/something guest ok = no read only = no create mask = 0775 valid user = abc

On windows 10, I used user abc to access the samba share. I notice that I don't have permission to write to the folder. It is weird to me because abc is the owner of the directory and it should have full access. I changed the permission with chmod 775 and abc can now write so I have the conclusion that it is using the group permission to access instead.

Why is it? I thought owner permission has priority over group. Is this how it works or just how samba handles permission?

Also is directory mask needed in smb.conf? How is it different from the directory permission itself?

  • If you create a file which owner does it have? Commented Jan 9, 2018 at 21:01
  • With chmod 775 ./ I created file & directory. Both show the smb user as owner and group. Weirdly the file has 766 even though I have create mask = 0775 but that's another question. I set it back to chmod 755 ./ and I am unable to create file nor directory.
    – Alf
    Commented Jan 10, 2018 at 0:54
  • Without Samba: Can the user create files there directly under Linux? Commented Jan 10, 2018 at 7:22
  • Yes. I just tried logging in linux using that user and successfully touched a file with the directory permission 755.
    – Alf
    Commented Jan 10, 2018 at 17:14
  • You could set the samba logging level to maximum. Maybe the logs tell you then what's up. Commented Jan 10, 2018 at 19:06

2 Answers 2


If you do not configure directory mask then a default value is used. This value is equivalent to the umask of a process. It affects the permissions of newly created directories.

A new directory has these permissions:

directory mask 000
directory mask 755
directory mask 777
  • I thought create mask = 777 is used to set permission of new files/directories. Instead of directory mask
    – Alf
    Commented Jan 9, 2018 at 21:35
  • 2
    @Alf create mask is for files, directory mask is for directories. Commented Jan 9, 2018 at 21:40
  • Well noted. I'll include that as well.
    – Alf
    Commented Jan 9, 2018 at 21:53

I just experienced these exact symptoms. Centos 8, Samba 4.11.2. Turned out to be a problematic cache. I adapted command lines (as superuser, naturally) found on this Kombitz page for my specific setup as follows:

systemctl stop nmb
systemctl stop smb
net cache flush
cd /var/lib/samba
rm *.tdb
systemctl start nmb
systemctl start smb

After doing this, the problem went away; Samba began correctly applying user permissions instead of the user's group permissions. Reboot wasn't necessary.

You must log in to answer this question.

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