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 10.1.1.10) as described here but do uncheck ALL boxes in the adapter settings except IPv4 connectivity (including the Client for Microsoft Networks):
http://sumofungus.wordpress.com/2010/07/23/ssh-tunneling-samba-on-windows-7/
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)
Reboot.

The connect line for SSH is as follows:

ssh -2 -q -f -N -g -L 10.1.1.10:139:192.168.1.195:139 -L 10.1.1.10:445:192.168.1.195:445 user@server
(replace 10.1.1.10 with the loopback IP and 192.168.1.195 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:
\\10.1.1.10\storage_backups

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).

Done.

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.