
After finally getting my FreeNAS and ZFS-based file server up and running, I’ve been looking at ways to access its services from remote locations outside of my home network. There are numerous ways to achieve such a feat, such a creating a VPN between your remote computer and the server. However, VPN’s typically require either special software installed on the server (which FreeNAS lacks, like Hamachi) or dedicated hardware running on the network (such as a machine running OpenVPN), which I lack. FreeNAS, however, does contain SSH, allowing you to create a sudo-VPN called an “SSH tunnel.” An SSH tunnel is a secure, encrypted connection between the remote computer and the file server for a specific port. Each service running on the server uses different ports, thus it is necessary to create numerous tunnels - once for each service you which to access remotely. After reading a number of online tutorials, most of which were geared towards Windows or the CLI, I discovered a very easy way to set up tunnels between a Mac OS X remote machine and the FreeNAS server, which I’ll describe here in detail.On the server/local network:
On the Remote Mac OS X-based Computer:
If everything was performed correctly, your FreeNAS share should now show up under “Shared” machines in the Finder, and you can connect and browse files as if you were on your local network.Other Services:You can also enable other service besides Samba, such as iTunes sharing. As I add more tunnels for remote services to my remote connection, I’ll update this tutorial with the required ports and information.
Optional: Finally, with SSH, you can enable the use of secure certificates between your Mac and FreeNAS server to allow logging in via SSH without having to enter a password for the FreeNAS user account. I may add the instruction on how to do this to the tutorial, but for now, there are numerous tutorials on the internet about how to do this. Note, you’ll need to use the command line to accomplish this completely optional feature.