Wed, 2015-04-22 08:05martinbrampton
When you want to connect a client to a database server through an insecure network, there are two main choices: use SSL or use an SSH tunnel. Although SSL often may seem to be the best option, SSH tunnels are in fact easier to implement and can be very effective. Traffic through an SSH tunnel is encrypted with all of the security of the SSH protocol, which has a strong track record against attacks.
There are various ways to implement an SSH tunnel. This article
suggests a simple approach which is adequate in many situations.
For the examples here, let’s assume that there is a database
server running on a host named, server.example.com,
with an IP address of 1.2.3.4. Suppose further that
the client is on a host named, client.example.com,
with an IP address of 5.6.7.8. We’ll also suppose
that there are tightly configured iptables …