How to maintain a persistent SSH connection?

Nico Kadel-Garcia nkadel at
Thu Nov 16 00:42:19 AEDT 2017

On Wed, Nov 15, 2017 at 8:08 AM, martin f krafft <madduck at> wrote:
> Hello,
> I'm tasked with establishing a persistent SSH connection across
> a very unreliable link, for a remote port forward (always port
> 2217). I figured I'd use ServerAliveInterval to make sure that the
> ssh(1) process dies when the connection appears down, and I use
> systemd to restart it in this case. This works fine.

I use "autossh" for precisely this reason, partly because I've found
it very effective at re-establishing the link, partly for the logging,
and partly for the daemonization of what can be used to keep an SSH
tunnel alive consistently.

More information about the openssh-unix-dev mailing list