5

I Have a partition called D:\ shared at a Windows machine, and In my Ubuntu server 12.4 I Have this line at fstab to mount it

//10.0.0.39/D$/ /mnt/charles/ cifs user,file_mode=0777,dir_mode=0777,rw,gid=1000,sec=ntlmv2,credentials=/root/creds 0 0

I've added the option "sec=ntlmv2", because was appearing this message every time I boot/reboot my ubuntu.

CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from nbtlm to ntlmv2 in kernel realese 3.3

Now I can't mount with this "sec=ntlmv2" option, because appear to me.

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

Can someone help? Thanks in advance!

This is the result with --verbose, what this can help to find the problem?

root@PITCAIRN:/mnt# mount -t cifs //10.0.39/D$/ /mnt/charles --verbose -ouser=Yamash,sec=ntlmv2 
Password: 
mount.cifs kernel mount options: ip=10.0.0.39,unc=\\10.0.39\D$,sec=ntlmv2,ver=1,user=Yamash,pass=********
mount error(22): Invalid argument 
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) 

--EDIT-- Zetrocker came with the solution, I changed the "sec=ntlmv2" to "sec=ntlmssp" and now it's working.

Thanks Zetrocker

2 Answers 2

6

Try something like this:

//10.0.0.39/D$ /mnt/charles cifs --verbose user,file_mode=0777,dir_mode=0777,rw,gid=1000,sec=ntlmv2,credentials=/root/creds 0 0

This should at least be a bit more verbose.

There is a thread found at Stack Overflow

There are a good number of people that had success after installing the cifs-utils

code:

sudo apt-get update
sudo apt-get install cifs-utils
7
  • This is the result with --verbose, what this can help to find the problem? root@PITCAIRN:/mnt# mount -t cifs //10.0.39/D$/ /mnt/charles --verbose -ouser=Yamash,sec=ntlmv2 Password: mount.cifs kernel mount options: ip=10.0.0.39,unc=\\10.0.39\D$,sec=ntlmv2,ver=1,user=Yamash,pass=******** mount error(22): Invalid argument Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) Jan 15, 2014 at 14:58
  • 1
    The error 22 is evidently a very vague message. It looks like your UNC address is not in a proper format. if not the \\COMPUTERNAME then make it the IP address again.
    – Zetrocker
    Jan 15, 2014 at 21:16
  • 1
    I also added a possible solution above. There are some other solutions in that thread, including checking windows permissions and using samba-client
    – Zetrocker
    Jan 15, 2014 at 21:26
  • 1
    I can mount without the option sec=ntlmv2 or with sec=ntlm, but not with sec=ntlmv2 Jan 16, 2014 at 1:49
  • 8
    I found a thread that says that the sec=ntlmssp option will work in lieu of ntlmv2 source
    – Zetrocker
    Jan 18, 2014 at 17:41
2

As mentioned in a comment in the accepted answer, adding sec=ntlmssp to my mount options worked for me.

I had CIFS mounts working and added in /etc/fstab, then one day they were failing to connect and the AD account used for auth had become locked. After having the account unlocked, the account was still failing to auth when attempting to mount.

Troubleshooting - using smbclient to list the share information using the same account that was failing in the mount command.

sudo smbclient -L service -A /root/credentials.txt

This command listed the available shares successfully but running

sudo mount -t cifs -o credentials=/root/credentials.txt //server/share /mnt/share

was failing with a permission denied error. I was also seeing this error in /var/sys/messages

Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
CIFS VFS: Send error in SessSetup = -13

This page was helpful in resolving and at least partially explaining what happened. https://www.suse.com/support/kb/doc/?id=7015602

Apparently a windows admin may have added extended security which may explain why initially my mount was fine, but then later needed an additional setting.

Original /etc/ftab entry which worked for a time

//server/share /mnt/share cifs _netdev,credentials=/root/credentials.txt,uid=1000,gid=1000,file_mode=0770,dir_mode=0770,noperm 0 0

New /etc/fstab entry with sec=ntlmssp added

//server/share /mnt/share cifs _netdev,sec=ntlmssp,credentials=/root/credentials.txt,uid=1000,gid=1000,file_mode=0770,dir_mode=0770,noperm 0 0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .