7

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?

lgeorget
  • 13,656
  • 2
  • 41
  • 63
spookypeanut
  • 230
  • 1
  • 2
  • 9

2 Answers2

6

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
Daniel
  • 659
  • 1
  • 9
  • 23
3

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.

heemayl
  • 54,820
  • 8
  • 124
  • 141
spookypeanut
  • 230
  • 1
  • 2
  • 9