I recently built a small server machine, using Ubuntu Server and Samba, to act as a file server (among other things) so that my entire family can access certain files over the network from Windows machines. However, I would love to take this a step further and have the shares be accessible over the internet, away from home. How would I do this? I know very little about how the Windows network shares system works, so I have no idea where to start.
With Samba, you need to expose ports 139/tcp and 445/tcp to the outside – usually this involves configuring "port forwarding" in your router. Additionally, you must make sure that your external IP address is pingable from the outside.
After this, you'll be able to access the shares by entering
Note, however, that the CIFS protocol used by Windows file sharing does not provide data encryption (so anybody with a packet sniffer can monitor your file transfers), and its authentication is not especially strong either.
Also note that Windows machines by default remember the login credentials for the entire local session. Unless you're connecting to Samba as "Guest", you must take special care on public machines: always use
For some extra security, add the following to general section in
If your family can handle using WinSCP then:
You'll then have a very secure method of transferring files that isn't too difficult to use.
However, if you really want the "network drive" integration with Windows, I'd learn about OpenVPN and then setting up a bridged tunnel to your home network. I've successfully gotten Windows fileshares to work over such tunnels.
You can also use PoPToP (pptpd) to allow a Windows system to connect back to your Ubuntu box via a PPTP vpn. (An IPSec/L2TP tunnel would provide better security but it is difficult to setup).
It depends on what kind of files you intend to serve. If these are documents, or just files you need to access remotely, just run an FTP server on your Ubuntu server. Make sure you secure it well, with good passwords, and access to just the file directory, and not the root.
If however you intend to stream media files (songs, movies), you're looking at running a streaming server. There are plenty of solutions for that (here's one).
Finally, you could always use an existing "cloud" drive solution like Dropbox or SkyDrive, or Amazon Cloud Player - just synchronize your files with one of those services and internet access (a speedy one at that) is guaranteed.