From: Kristof Provost Date: Wed, 26 Feb 2025 20:37:31 +0000 (+0100) Subject: image: enable keepalives on the reverse ssh tunnel X-Git-Url: https://git.sigsegv.be/?a=commitdiff_plain;h=3b9fae4e26805a36ad249c257f50ffe018553bd6;p=pennestraat-domotica image: enable keepalives on the reverse ssh tunnel We've seen the reverse ssh connection become unusable after some time. It's assumed this happens because NAT and/or firewall states along the path time out as there's no traffic. Explicitly enable both SSH and TCP keepalive mechanisms to avoid this. --- diff --git a/image/overlay/domotica/etc/rc.d/autossh b/image/overlay/domotica/etc/rc.d/autossh index cb149bb..e690732 100755 --- a/image/overlay/domotica/etc/rc.d/autossh +++ b/image/overlay/domotica/etc/rc.d/autossh @@ -21,6 +21,9 @@ autossh_start() "AUTOSSH_POLL=120 AUTOSSH_MAXLIFETIME=28800 \ autossh -M 0 -p 2207 -N -R ${control_port}:localhost:22 \ -R ${http_port}:localhost:8123 \ + -o ServerAliveCountMax=6 \ + -o ServerAliveInterval=15 \ + -o TCPKeepAlive=yes \ -o ExitOnForwardFailure=yes \ domotica@kosmos.sigsegv.be" }