Windows File Sharing (SMB/CIFS/Samba) over SSH
In order to come up with a reliable solution to this we decided to use the SSH server we had available and tunnel the windows sharing across the local port forwards, much simpler and more reliable.
Thanks to this article it was a breeze to set up.
Steps are as follows:
- Create loopback adapter on windows
- Configure loopback adapter on windows
- Reboot
- Configure SSH connection
- Test it all out
Create loopback adapter on windows
We'll give your computer an additional (fake) IP address, and we'll port forward to that address instead of the computer's real IP. Windows XP will continue to do file sharing on the real IP address. We'll assign it an IP of 10.0.0.1 (that's what we configured putty to use above.)
- System->Control Panel->Add Hardware
- Yes, Hardware is already connected
- Add a new hardware device (at bottom of list)
- Install the hardware that I manually select
- Network adapters
- Microsoft , Microsoft Loopback Adapter
- (Go through the installation procedure.)
Configure loopback adapter on windows
- Open your new fake ethernet adapter (Network Connections) , enter a made-up IP address (I suggest 10.0.0.1, which is a privately routable address that most folk don't use.)
- Enable Client for Microsoft Networks.
- Disable File and Printer Sharing for Microsoft Networks
- Enable Interent Protocol (TCP/IP)
- Click on properties for TCP/IP.
- Enter your chosen IP address (10.0.0.1), subnet mask (255.255.255.0). You can leave gateway blank.
- Under advanced->WINS, Enable LMHosts Lookup and Disable NetBIOS over TCP/IP
Reboot
In order to make it all work now it he appropriate time to reboot so windows initialises everything correctly.
Configure SSH connection
- Download Putty
- Enter IP address
- Enter Auth Key (if using SSH keys)
- Enter Port forwards for: (these connect the ports on you local machine to
- 10.0.0.1:137 to 127.0.0.1:137
- 10.0.0.1:138 to 127.0.0.1:138
- 10.0.0.1:139 to 127.0.0.1:139
- 10.0.0.1:445 to 127.0.0.1:445
- Save the config.
Test it all out
Now to connect you need to do the following steps:
- Open putty, load the settings and connect.
- Open Exporer and type in: \\10.0.0.1\
You should now be connected to your remote windows system over a secure encrypted tunnel.
Cheers, Mark


Prism is a cut down version of Mozilla which is designed to run single sites from icon - what's the use of that you may ask? Well it allows you to have an icon on your desktop for Gmail or Google Calendar or docs or analytics and get to it nice and quickly.