Using Samba over Internet
Tuesday, April 8th, 2008Abstract
This article describes how to use Samba shares configured on a linux server on a Windows client. This article is a guide for use of our RSync backup solutions on Windows servers.
Software You Will need
First of all it must be said, that SMB shares are not designed to work over internet and thus should generally not be mounted directly on the client machine. Instead, we are going to use an SSH tunnel and send our SMB traffic through that tunnel making all data transfers secure. SSH access is enabled by default on our RSync backup solutions and you should already have the account details available to you.
First of all you will need a Tunneling software. Please download it from our downloads section:
http://torqhost.com/whmcs/dl.php?type=d&id=2
or in http://torqhost.com/whmcs/downloads.php type SSH Tunneling Software in the search field to find the file.
Next unzip and install this software.
This is all the software you will need!
Setting Up The software and preparing Windows
Open up the software you just installed and go to the settings tab. There, you need to enter the IP, username and password, which were provided to you upon account creation.
For simplicity, you can tick the Connect on Startup and Reconnect on Failure flags.
After this go to the tunnels tab. Here we will setup the tunneling. In the Local Section (left one), type the following
10.0.0.1:139:IP_OF_SSH_SERVER:139 . IP_OF_SSH_SERVER is the same IP you entered on the Settings tab, unless instructed otherwise in the welcome email.
Ok, now we need to setup a loopback interface in Windows. We do this because Windows always reserves the 139 port for it’s own purposes. To create a new adapter do the following:
- Open the “add hardware” wizard from the control panel.
- Wait for it to search in vain for new hardware.
- Tell it “yes, I’ve already connected my hardware” or the wizard will end…
- Pick “add a new device” from the bottom of the list.
- Don’t let windows search for the hardware but choose it from a list (”Advanced”).
- Pick the category “Network adapters”.
- Choose “Microsoft loopback adapter”.
- Now, you need to go to the networking settings in the Control Panel. There locate the new network connection you just created and do the following:
- Open the “properties” dialog from the contextmenu in the “network connections” overview.
- Deselect all bindings except the TCP/IP ones. Typically you’ll need to deselect “client for Microsoft networks” and “File and printer sharing”.
- Select “TCP/IP”, and then “settings” (or “properties”)
- Choose any private network IP address you’ll never see in any real network. (10.0.0.1 is a good example)
- Click “Advanced…”
- Choose the tab titled “WINS”
- Under “NetBIOS settings”, click on “Disable NetBIOS over TCP/IP”
After that save the changes (by clicking OK all the time). Now return to the tunneling software and hit save, then connect. After a few seconds the lock icon in the system tray should turn green. That means, that the tunnel is successfully established.
After this, in the windows run console (Windows Logo + R) you can type \\10.0.0.1\SHARE_NAME
The SHARE_NAME is typically your username, unless indicated otherwise in the welcome email.