Mount Vista network drive through ssh tunnel through VPN

I can access a linux computer at my office through vpn. I want start a ssh connection and tunnel the smb port(s) to samba server (another computer at the office). Then I want to map a network drive on my laptop to the samba disk. I think I finally got it. However, Microsoft sometimes really seems to make things difficult.

My solution:

Create a loopback adaptor at 10.0.0.1, and map ports 10.0.0.1:445 and 10.0.0.1:139 to <samba-server>:139
http://www.blisstonia.com/eolson/notes/smboverssh.php

Prevent that the smb service grabs the 10.0.0.1:445 port
http://social.technet.microsoft.com/Forums/en-US/itprovistanetworking/thread/d30d3c98-58c5-47f6-b5a5-f5620882020d/#page:2

I have in improvement that works automatically at startup:
create the following start_smb file and put it in the autostart:

# batch file to start the smb service without port 445
# Peter Steier 2009-02-28
start “bind_port_445” “C:\Program Files\nc.exe” -l -s 10.0.0.1 -p 445
net start smb
ping 127.0.0.1 -n 2 -w 1000 > nul
taskkill /fi “Windowtitle eq bind_port_445”

How to get this running with the task scheduler on startup with administrator privileges with UAC dialog is explained here:
http://forums.phoenixlabs.org/showthread.php?t=17871

Additinally, I had to set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Lsa\LmCompatibilityLevel to 1 (from 3). See http://www.mcseboard.de/windows-vista-forum-55/vista-sambalaufwerke-108079.html

After every start, I have to start the vpn, and then the ssh connection with the forwarding.

Map a network drive to \\10.0.0.1\<share>

-> it works!

Not really easy, isn’t it?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: