3

I want to mount windows network share with different permissions based on group owners should have read/write permissions, others, only read permissions

I am adding the following line in /etc/fstab

//192.168.OO.PP/Public           /mnt/storage            cifs    nofail,iocharset=utf8,noperm,uid=XXX,password=%^%^,gid=XXX,file_mode=0775,dir_mode=0775   0    0

What happens is not only group owners, but all users has read/write access, instead other users to have readonly access

0

In some cases you might need to use ...,file_mode=0775,dir_mode=0775,nounix

Despite those options are deprecated you can use fmask (for files), dmask (for directories) or umask (for files and directories). It works as the normal octal permissions but subtracted from 7. For instance if you want to set the permissions to 0775 you will need to set it 0002 in the umask (e.g. umask=0002).

  • thank you, but adding nounix does not change anything and using umask instead prevents mounting at all – Plamen T Djonev Aug 30 '18 at 3:19
  • ok the problem was with noperm option, replacing with perm solved it – Plamen T Djonev Aug 30 '18 at 3:49
0

You can use this parameters:

//host/share    /net/share        cifs   user,noauto,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10,workgroup=workgroup,credentials=/foo/credentials    0 0

Permissions will be shown as:

drwxr-xr-x directory
-rwxr-xr-x file

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.