Make a network drive available over the internet?
With Samba, you would have to expose port 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 \\youraddress
in Explorer's address bar or in Start - Run. (Here youraddress is either your external IP address or your DNS name, if you have one.)
Note, however, that the CIFS and SMBv2 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. Only SMBv3 gained encryption support.
Also, don't forget that the Windows' SMB service has in the past been a very frequent infection target. While most Windows exploits do not affect Samba in any way, this is still worth remembering (and often means that the SMB ports get blocked at ISP level).
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 net use \\address
before opening in Explorer / net use \\address /del
to disconnect. (This is not needed on personal computers.)
For some extra security, add the following to general section in smb.conf
:
LANMAN auth = no
NTLM auth = no
invalid users = root
If your family can handle using WinSCP then:
- install and setup SSH
- give your family members local accounts on your server
- symlink your file store into these directories. For example, if you are exposing
/srv/samba_files
through Samba, you'd want to do anln -s /home/{user}/files /srv/samba_files
or similar for each account. If you have to do this for many accounts you could write a script to do it. - install WinSCP on your family's computers
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.