Context: I want to enable a normal user to mount a certain cifs mount on his system (Debian Strech). I therefore added the following entry in /etc/fstab (note the added ,user in the options):
//server/share/ /home/user/mountpoint cifs defaults,user,uid=user,credentials=/home/user/.cifs-creds 0 0
Also the credential-file is owned by the user and is readable/writable/executable (700).
Subsequently mounting as root works (i.e. cifs-utils are available on the system, the credential-file exists and is correctly populated)! But mounting as a user does not, resulting in the following output:
user@system: ~$ mount mountpoint
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
/var/log/kern.log states:
Jun 4 11:36:52 system kernel: [173283.233509] CIFS: Unknown mount option "defaults"
So, somehow, when executed as a user, the defaults option can not be used to mount? When the ,defaults option is removed from the fstab entry, users can mount (without error) but that would leave out a lot defaults (and using the defaults (other than: ,user) should be possible right?).
Hence my question:
- What is the advised fstab entry to have users mount a CIFS/SAMBA share to prevent the
mount error(22): Invalid argumentcaused by theCIFS: Unknown mount option "defaults"?
Should I simply leave out ,defaults or is there another method to do this (I tried Googling on this, but every tutorial / explanation I find seems to confirm the method used)?