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

  • 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 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 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 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 at 21:30
  • 1
    removing sec=ntlm from fstab worked! – Greeny2408 Jan 12 at 15:00

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.

  • 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. – Moilleadóir Jan 14 at 7:06
  • 3
    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. – Ian Gallagher Feb 6 at 8:45
  • @IanGallagher I will give it a try and will post the results. Thank you! – Greeny2408 Feb 21 at 19:06

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.

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 commandline:

# 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

New contributor
Zefiro is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.