11

A few hours ago i made a full update via the software-center. The mounted shares allready worked fine, but after updating i just get this error message:

mount error(22): Invalid argument Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

This is how my shares are mounted in fstab:

//IP-of-server/samba-directory  /Path-to-mount-point/ cifs users,noauto,uid=1000,gid=1000,credentials=/path-to-credentials,iocharset=utf8,sec=ntlm   0       0

using

mount -a

does not show any errors. Trying to access the share with the File-Explorer directly (using smb://path-to-server) works fine as well. I have allready tried to use the "vers" option, but with no success.

using

tail -f /var/log/kern.log

returns

CIFS VFS: Unable to select appropriate authentication method!

Thank you for your help and replying

6
  • i have allready read link this post and all solutions doesn't seem to work, but adding vers=1.0 worked! So may edit this post and leave the quotes. But i actually do not know why this has changed. The server provides samba 2 and higher.
    – Greeny2408
    Jan 11 '18 at 19:29
  • vers= has to do with the [SMB]( en.wikipedia.org/wiki/Server_Message_Block) (Server Message Block) protocol and not SAMBA itself. SMB is the communications type where SAMBA is the server. Chances are when you upgraded CIFS, the SMB default type changed. It was probably trying to communicate at a different SMB version like 2.0, 2.1 or 3.0.
    – Terrance
    Jan 11 '18 at 19:48
  • Thank you Terrance for your fast reply! SMB was of course what i meant, sorry. The server itself should just use smb2 to smb3 (set min protocol = smb2 and max protocol = smb3) thats why i am confused that it works with vers=1.0 . cifs or cifs-utils package is at version 6.4 . But at least it works and thank you for your very nice explanation!:)
    – Greeny2408
    Jan 11 '18 at 20:54
  • I wonder if the authentication has to do with plain text passwords that it is using in the credentials file that is being transmitted. Try setting on the server in the [global] section both ntlm auth = no and client ntlmv2 auth = yes.
    – Terrance
    Jan 11 '18 at 21:30
  • 1
    removing sec=ntlm from fstab worked!
    – Greeny2408
    Jan 12 '18 at 15:00
18

I actually do not know why, but after update the sec=ntlm option for cifs in fstab does not work anymore and forced me to use the option vers=1.0. After removing sec=ntlm it works again. I think the new version of cifs uses a more secure dialect.

5
  • 2
    According to man mount.cifs the defaults (i.e. what you get if you don’t specify these options at all) are vers=1.0 and sec=ntlmssp. Jan 14 '18 at 7:06
  • 13
    I changed my sec=ntlm to sec=ntlmssp (hence the new default?) and it works for me now. I still have vers=3.0 as well. Feb 6 '18 at 8:45
  • @IanGallagher I will give it a try and will post the results. Thank you!
    – Greeny2408
    Feb 21 '18 at 19:06
  • confirmed. After removing sec=ntlm it worked again Jan 1 '19 at 10:11
  • 2
    sec=ntlmssp setting this option in fstab worked for me. Mar 11 '19 at 7:40
12

I just had the same issue with this line in fstab and after upgrading Ubuntu

//10.0.0.10/D$ /mnt/toruk/d  cifs credentials=/etc/winpassword.txt,iocharset=utf8,sec=ntlm,ro 0 0

Which got me the same error message on the command line:

# mount /mnt/toruk/d
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

and in /var/log/syslog

Sep 14 22:48:13 truhe kernel: [67664.396524] CIFS VFS: Unable to select appropriate authentication method!
Sep 14 22:48:13 truhe kernel: [67664.396529] CIFS VFS: Send error in SessSetup = -22
Sep 14 22:48:13 truhe kernel: [67664.396658] CIFS VFS: cifs_mount failed w/return code = -22

Adding the parameter vers=1.0 did make it work again, however the default was changed for a reason, and there had to be something better than fall back to the insecure deprecated protocol.

Thanks to this answer and comments I could get it to work again by not using vers, but changing sec=ntlmssp

//10.0.0.10/D$ /mnt/toruk/d  cifs credentials=/etc/winpassword.txt,iocharset=utf8,sec=ntlmssp,ro 0 0
1
  • Thank you! Connecting Ubuntu 19.04 with with Windows server 2019. the config previously had sec=ntlm, changing it to ntlmssp worked, but removing the sec param entirely worked great too!
    – DanO
    Sep 13 '19 at 7:01
0

I am using pam_mount to automatically mount drives on login. When I updated to Xubuntu 16.04.3 the login process would no longer complete. It just hung. I tested manually mounting CIFS shares and saw that it never exited from the mount command.

I had to add a vers=1.0 to the mount options to mount cifs shares from my SuSE CIFS shares. Once I did that everything worked fine.

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.