How to make a cifs/smb mount ignore umask?
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
spookypeanut
Updated on September 18, 2022Comments
-
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 theumask=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 almost 10 yearsHow about the
file_mode
anddir_mode
options? -
Admin almost 10 yearsFrom 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 over 2 yearsIs
noperm
safe? - The files are based according the owner and primary group and ugo permissions