It is surprisingly easy to set up SSH tunnels. All you need is SSH access to a box with Internet connection that will act as the port forwarder. Something as simple as the following command with set up an encrypted tunnel that will forward the local_port on the ssh box to the remote_port on the remote_host.
ssh -N -L local_port:remote_host:remote_port user@local_host
And that’s it. The “-N” argument tells SSH not to run any commands, which is the behaviour required when setting up tunnels. The “-L” argument sets up the port forwarding stuff.
That command will run in the foreground, or background if you suffix an ampersand to it, and will gladly service requests destinted for local_port on the ssh box (localhost, here).
It is important that TCP-Forwarding be enabled for this to work. In order to enable that, the directive
must be set in the SSH daemon’s config file (man sshd_config(5)).