Score:0

mounting smb via ssh tunnel - malformed UNC

id flag

on my Fedora box i want to mount a Windows Server Share via a ssh tunnel. The setup consists of two parts, ssh and mount part.

Part 1.) i do a ssh portforwarding of Port 445 from windows server to my Fedora box via a linux gateway

sudo ssh -C -L 127.0.0.2:445:msserver:445 [email protected]

that works fine and i can access the Windows Server share on my Fedora box in Filemanager or with smbclient on address smb://127.0.0.2

ok, but i want to use that share via linux filesystem. Therefore i need to mount it

sudo mount -t cifs //127.0.0.2 /mnt/smb -o username=domaineuser.msserverdomaine

but now the problems occure. It asks me about the domaine password on the MS Server.

Password for domaineuser.msserverdomaine@//127.0.0.2:

which seems already not like a valid account. And after providing the pwd i got a

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Dmesg shows me

[41077.581330] CIFS: VFS: Malformed UNC in devname
[41109.021447] Malformed UNC in devname

So, wheres my mistake? It seems clear that mount got's confused with the ssh portforwardimng. What to do?

Score:1
bd flag

Your syntax for specifying the domain name is wrong. Try:

sudo mount -t cifs //127.0.0.2 /mnt/smb -o username=domaineuser,domain=msserverdomaine
Chris9834 avatar
id flag
Thank you. You pointed me to the correct and complete solution. What was missing is the ability to write to the mounted share via sudo mount -t cifs //127.0.0.2 /mnt/smb -o username=domaineuser,domain=msserverdomaine,uid=LinuxUserID,gid=LinuxUserGroupID
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.