Windows 8/Windows Server 2012: Mount samba/ZFS share over SSH tunnel

As it took me more than 2 hours to figure out why this just would not work here’s a small tutorial to mount an SMB share over SSH (in my case Cygwin, but PuTTy should work as well):

First, add a new hardware loopback adapter + an IP (in this example as described here but do uncheck ALL boxes in the adapter settings except IPv4 connectivity (including the Client for Microsoft Networks):
Do note that the adapter has a slightly different name in Windows 8/2012 – “Microsoft KM-TEST Loopback Adapter”.

Now press Windows Key + r and enter services.msc, press enter – search for the service named “Server”, open its settings and set it to deactivated.
(This will make it unable to share local drives in the local network, so if you need this set it to delayed)

The connect line for SSH is as follows:

ssh -2 -q -f -N -g -L -L user@server
(replace with the loopback IP and with the server IP)
If you use key authentication it will automatically switch to background.

Open the normal Windows share mount, enter the local IP and remote sharename:

You can also do the forwarding on a dd/openwrt router and then mount on all PCs in the network without Windows changes, however most ARM based routers only do around 2MB/s total (Tested: Dlink DIR-825) so a x86 based install is recommended (or a VM).


This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.