ServerAliveInterval doesn't work if client keeps trying to send data

J Raynor jxraynor at gmail.com
Sun May 24 07:36:30 AEST 2020


The ServerAliveInterval option is supposed to check the connection "if
no data has been received from the server" during the interval.
However, if the client side keeps trying to write data, the check is
never performed.

For example, run this command:

while true; do date ; sleep 3; done | ssh -o ServerAliveInterval=10 -o
ServerAliveCountMax=2 YourSshServer cat

Once the connection is established, break the communication between
the client and server.  For example, add a bad route to the client on
YourSshServer, or take down the server's network interface, or pause
the server if it is a VM.

Once the communication is broken, given the options listed above, the
connection should time out in about 20 seconds.  But it won't.  It
appears to stay alive until a tcp timeout occurs.

Is the ServerAliveInterval option only supposed to work if the client
is idle?  Or, at least, only if the client tries to transmit data less
often than the interval?


More information about the openssh-unix-dev mailing list