Figuring out how to configure FreeBSD services. We’ll break down the configuration for a simple service, linking you to all the relevant docs along the way.
The service we’re setting up is syncthing, which I use to synchronise files across my devices via my home server. It works very well and I wholeheartedly recommend it.
Although ssh -D is an option, it’s a bit overkill because connections aren’t limited to just a single port – it’s allowing apps on the client to connect to any port and/or network interface on the remote host.
A simpler and more secure option is to forward just the required port. Then you won’t need to change proxy settings and/or rely on web browser add-ons.
For OpenSSH, the command syntax is as follows:
ssh -L local_port:host:host_port user@remote_host
For example…
ssh -L 1234:127.0.0.1:8384 logmein@10.10.10.10
ssh– OpenSSH client.-L– Forward a local network port.1234– A locally available network port to listen on.127.0.0.1– Host to forward connections to.8384– Network port on the specified host being forwarded to.logmein@10.10.10.10– Remote host to tunnel to, logging on aslogmein.
Now choose any suitable web browser – no proxy changes and/or proxy add-ons required – and go to http://127.0.0.1:1234/.
Connections to local port 1234 are tunneled thru remote host 10.10.10.10 and forwarded to 127.0.0.1:8384 where Syncthing’s built-in web server is waiting for connections.
For convenience, add the following OpenSSH configuration block to ~/.ssh/config:
Host syncthing-webui
LocalForward 127.0.0.1:1234 127.0.0.1:8384
HostName 10.10.10.10
User logmein
Then to open the SSH tunnel, refer to the host alias:
ssh syncthing-webuiSyncthing Windows Setup provides a Syncthing installer for Windows, built using Inno Setup. It provides the following features:
-
Installs the appropriate Windows platform (AMD64, etc.) version of Syncthing using a single installer
-
Supports non administrative (current user) and administrative (all users) installation (see Administrative vs. Non Administrative Installation Mode)
-
When installing for the current user, Setup creates a scheduled task that starts Syncthing at logon (if selected)
-
When installing for all users, installs Syncthing as a Windows service using shawl (see Windows Service Installation)
-
Supports adding a Windows Firewall rule for Syncthing (see Windows Firewall Rules)
-
Installs a set of scripts for ease-of-use (see Scripts)
-
Supports silent (hands-free) installation (see Silent Install and Uninstall)
-
Allows localization of Setup and scripts (see building.md file for details)