How to make a cifs/smb mount ignore umask?

13,284

Solution 1

As suggested in my question, it was a server-side change that needed making. I added these lines to /etc/smb.conf on the server:

create mask = 0666
force create mode = 0666
directory mask = 0777
force directory mode = 0777

And now it works fabulously.

Solution 2

The noperm fstab option allows all users to read and write to the CIFS mount (which is what umask=000 would have done if it was supported by mount.cifs).

Example line in /etc/fstab:

\\computer\UNC\path  /mnt/path  cifs  auto,rw,user,noperm,credentials=/path/to/credentials.txt  0 0
Share:
13,284
spookypeanut
Author by

spookypeanut

Updated on September 18, 2022

Comments

  • spookypeanut
    spookypeanut over 1 year

    I have a cifs mount that is mounted from /etc/fstab. But I would quite like creation of files/dirs on that share to ignore my umask. Is that possible? It seems that cifs does not support the umask=000 option (source: man mount.cifs).

    My current best option is to set my system-wide umask to 000, but I'd rather not do this as I'd like to keep the local machine a bit more locked down. The silly thing is that my previous NAS did this fine, so maybe it's a server-side change that's required?

    • Admin
      Admin almost 10 years
      How about the file_mode and dir_mode options?
    • Admin
      Admin almost 10 years
      From what I understand, this only applies to existing files, if the server does not support the CIFS Unix extensions (which it seems mine did).
  • Manuel Jordan
    Manuel Jordan over 2 years
    Is noperm safe? - The files are based according the owner and primary group and ugo permissions