I'm running Lubuntu 16.04.1 on my laptop. At work, I plug it into the wall with an Ethernet cable. This provides Internet access and also lets me access a directory of files (perhaps a share, or is it a server, or both?) called cchfs (smb://cchfs
), which is used as a mapped network drive on the Windows machines here. I can see the files in cchfs by opening PCManFM, choosing Go → Network, and then opening the icons "Windows Network", "NPI_HRRP", "CCHFS" (here I'm prompted for my login details), "Root".
This all works fine, but I'd like to be able to interact with these files in zsh instead of just PCManFM, and I can't figure out how to do that. I think the first step, after creating a mount point with sudo mkdir /media/cchfs
, is to mount the filesystem like so:
sudo mount -t cifs -o user=NPI_HRRP/KArfer smb://cchfs /media/cchfs
but this produces the error Mounting cifs URL not implemented yet.
From this question, which is about this error message, it looks like I need to replace smb://cchfs
with //SOMETHING/cchfs
or //cchfs/SOMETHING
. But I don't know which, nor what the SOMETHING
should be. I've tried a lot of guesses but only gotten pretty cryptic error messages.
Edit 1: Following these instructions on a Windows machine at the office, I got:
C:\Users\karfer>net use
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
OK X: \\cchfs\root Microsoft Windows Network
The command completed successfully.
C:\Users\karfer>nslookup cchfs
Server: nsmcoint.medctr.ucla.edu
Address: 10.2.14.10
Name: cchfs.cch.ucla.edu
Address: 10.48.154.235
and so I tried:
sudo mount -t cifs -o user=NPI_HRRP/KArfer //10.48.154.235/cchfs /media/cchfs
which yields mount error(13): Permission denied
(-v
just adds mount.cifs kernel mount options: ip=10.48.154.235,unc=\\10.48.154.235\cchfs,user=NPI_HRRP/KArfer,pass=********
) and in dmesg
:
[ 2734.297317] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 2734.297332] CIFS VFS: Send error in SessSetup = -13
[ 2734.297591] CIFS VFS: cifs_mount failed w/return code = -13
I also tried //10.48.154.235/root
in place of //10.48.154.235/cchfs
, which didn't change anything.
I'm pretty sure I'm typing my password correctly. My password has capital letters and an exclamation point in it. Could that be a problem for mount
although it's seemingly not a problem for PCManFM?
Edit 2: It looks like my credentials get accepted if I use KArfer
in place of NPI_HRRP/KArfer
. (It doesn't seem to make a difference whether or not I pass in domain=NPI_HRRP
as well.) But now I get:
mount.cifs kernel mount options: ip=10.48.154.235,unc=\\10.48.154.235\cchfs,user=KArfer,pass=********
Retrying with upper case share name
mount.cifs kernel mount options: ip=10.48.154.235,unc=\\10.48.154.235\CCHFS,user=KArfer,pass=********
mount error(6): No such device or address
Changing cchfs
to a few other things doesn't change anything, except that if I use X$
in place of cchfs
, I get Permission denied
again.
Edit 3: The output of smbclient -W=NPI_HRRP -U=KArfer -L //CCHFS
is:
WARNING: The "syslog" option is deprecated
Enter KArfer's password:
Domain=[NPI_HRRP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]
Sharename Type Comment
--------- ---- -------
IPC$ IPC Remote IPC
Root Disk
X$ Disk
Domain=[NPI_HRRP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]
Server Comment
--------- -------
Workgroup Master
--------- -------
However, mount -t cifs -o username=NPI_HRRP/KArfer'%hunter2' //CCHFS /mnt
, replacing hunter2
with my password, yields mount error(22): Invalid argument
(after prompting for my password despite my inclusion of it in the command line). Same thing if I replace CCHFS
with 10.48.154.235
.
\!
and\/
. Check this: serverfault.com/questions/309429/…. Or according to: serverfault.com/a/170446/364207 you must use"quotes"
. Or change / add-sec
option: unix.stackexchange.com/a/124696sec
does change the error message in some cases:Unknown error 524
forsec=ntlmv2i
andInvalid argument
forsec=ntlmv2
.sudo mount -t cifs -o user=win-user,password=abc123 //192.168.1.110/Win-to-Ubuntu /mnt/test
- here it works. After changing of the password toabc!@3
correct command is:sudo mount -t cifs -o user=win-user,password=abc\!\@3 //192.168.1.110/Win-to-Ubuntu /mnt/test
. I think you should investigate the type of the server, but at the moment I don't have an idea how.!
(at least) has nothing to do with the server. It's just that!
is a metacharacter in the POSIX shell. Both\!
and\@
are resolved to the literal characters, so the backslash isn't sent over the wire.