1

Rewording:

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? – Hauke Laging Jan 9 '18 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 Jan 10 '18 at 0:54
  • Without Samba: Can the user create files there directly under Linux? – Hauke Laging Jan 10 '18 at 7:22
  • Yes. I just tried logging in linux using that user and successfully touched a file with the directory permission 755. – Alf Jan 10 '18 at 17:14
  • You could set the samba logging level to maximum. Maybe the logs tell you then what's up. – Hauke Laging Jan 10 '18 at 19:06
3

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
000
directory mask 755
755
directory mask 777
777
  • I thought create mask = 777 is used to set permission of new files/directories. Instead of directory mask – Alf Jan 9 '18 at 21:35
  • 2
    @Alf create mask is for files, directory mask is for directories. – Hauke Laging Jan 9 '18 at 21:40
  • Well noted. I'll include that as well. – Alf Jan 9 '18 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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