3

I try to mount cifs, but i have got following error and i don't find the error.

~# mount -a
~# mount error(22): Invalid argument

I try if in my /etc/fstab

//192.168.0.1/ShareRep /home/user/share cifs credentials=/usr/local/etc/whisper.credentials,uid=501,sec=ntml     0       0 

my credentials file /usr/local/etc/whisper.credentials

username=user
password=password

I am on Debian 7.6

Phane
  • 201
  • 3
  • 11

1 Answers1

2

In the absence of a more detailed error from dmesg I do see one typo that will cause things to fail. You have the option sec=ntml . This is is wrong and should be sec=ntlm . Notice how ml should be lm

It was determined that the OP was using OS/X as a Samba file server. There are some modifications (voodoo magic) to the options that need to be made to get this to work on most flavours of Linux. In partiuclar you need to specify the options nounix,sec=ntlmssp,noperm. I found this buried in a Ubuntu question (and answers) that mentions a thread of messages on the Apple forums. In summary this appeared:

With reference to this post in Apple discussion community, you can try to mount with additional two options: nounix,sec=ntlmssp

A followup post suggested noperm might be needed as well.

If you modify your fstab entry to be this it may work:

//192.168.0.1/ShareRep /home/user/share cifs credentials=/usr/local/etc/whisper.credentials,uid=501,nounix,sec=ntlmssp,noperm     0       0 
Community
  • 1
  • 1
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
  • I have run dmesg after having modified the option sec=ntlm `[ 6949.362333] CIFS VFS: cifs_mount failed w/return code = -22` `[ 7579.194571] CIFS VFS: cifs_mount failed w/return code = -22` `[ 7754.364913] CIFS VFS: cifs_mount failed w/return code = -22` – Phane Sep 23 '14 at 19:59
  • mount.cifs kernel mount options: ip=192.168.0.1,unc=\\192.168.0.1\ShareRep,sec=ntlm,uid=501,user=requarts,pass=******** mount error(22): Invalid argument Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) – Phane Sep 23 '14 at 20:13
  • with ntlmv2, `mount.cifs kernel mount options: ip=192.168.0.1,unc=\\192.168.0.1\ShareRep,sec=ntlmv2,user=requarts,pass=********` `mount error(22): Invalid argument` `Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)` – Phane Sep 23 '14 at 20:27
  • with ntlmssp, `mount.cifs kernel mount options: ip=192.168.0.1,unc=\\192.168.0.1\ShareRep,sec=ntlmssp,user=requarts,pass=********` `mount error(95): Operation not supported` `Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)` – Phane Sep 23 '14 at 20:28
  • i have run `smbclient //192.168.0.1/ShareRep -U requarts --signing=off` and i have got following response 'Domain=[WORKGROUP2] OS=[Darwin] Server=[@(#)PROGRAM:smbd PROJECT:smbx-276.92.2]' `smb: \>`, and it's ok – Phane Sep 23 '14 at 20:37
  • with uid=501, `mount.cifs kernel mount options: ip=192.168.0.1,unc=\\192.168.0.1\ShareRep,sec=ntlmssp,uid=501,user=requarts,pass=********` `mount error(95): Operation not supported` `Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)` – Phane Sep 23 '14 at 20:39
  • Aha, you are using OS/X as a server. Try this: `mount --verbose -t cifs //192.168.0.1/ShareRep /home/user/share -o credentials=/usr/local/etc/whisper.credentials,uid=501,nounix,sec=ntlmssp,noperm,rw` – Michael Petch Sep 23 '14 at 20:46
  • Thank you very much Michael, this is the solution. – Phane Sep 23 '14 at 21:13
  • I have updated my answer with the OS/X information. If you found it of use, I'd appreciate you considering accepting the answer. Thanks – Michael Petch Sep 23 '14 at 21:21
  • Sorry Michael, i wanted to add a comment to my question, not your answer. Yes, i accept your answer and thank you again Michael. – Phane Sep 23 '14 at 21:25