ExitOnForwardFailure=yes confirms SSH tunnel setup, not database availability
A technical analysis published on DEV Community clarifies a common misconception about SSH tunneling: the OpenSSH option ExitOnForwardFailure=yes only confirms that a local forwarding listener was successfully established, not that the service behind the tunnel is reachable. Testing conducted on macOS with OpenSSH 10.3p1 and Node.js 25.6.1 demonstrated that an SSH process can continue running even when the destination port returns a connection refused error. The experiment showed that a local TCP connection to the forwarding port succeeds independently of whether the target service is actually up. Developers troubleshooting PostgreSQL connection failures through SSH tunnels are advised to diagnose each layer separately: the local listener, the SSH transport, the destination connection, and the database protocol itself. A successful local TCP probe alone cannot verify a query, database identity, or authentication credentials, so the final check must use a proper database client with correct credentials and TLS settings.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in