0

I recently changed internet provider - still using the same router/modem - but my ssh sessions keep dropping now. e.g.,

client_loop: send disconnect: Broken pipe

My ssh config file has the following

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 4

which has been working perfectly until I changed providers.

Is there something else I need to update?

For further context, my actual internet connection is stable and does not drop out at the same time as the ssh connection.

1 Answers1

1

Try the solution from this U&L SE answer:

Some over-zealous routers like to drop TCP connections that are idle for too long (i.e. don't transmit any data). It might be because they assume the user only uses things like HTTP, where the connection is often closed after a single query is complete.

[…]

Something like these values should do:

ClientAliveInterval 15
ClientAliveCountMax 4

It's possible that with your previous internet provider there was no "over-zealous router" along the route your network packets go, but now there is (probably CGNAT).

The solution is to set ClientAliveInterval to a value low enough. What value is "low enough", it depends on the "over-zealous router".

If you are surprised a lower value of ClientAliveInterval may help, because you thought a lower value would unconditionally disconnect you sooner, then see this answer of mine; it tries to explain the purpose and the mechanics of ClientAlive* and ServerAlive*.