2
I know this is an odd request, but we've been asked to destroy an existing SSH connection as soon as a network disconnect is detected, e.g., if the network cable is unplugged. SSH normally works hard to keep its connection alive for quite some time, in hopes that the network will eventually come back, but we're told this is unacceptable and a network disconnect should trigger an immediate SSH termination.
Note this is different from the Client/ServerAlive settings, which time out after a period of inactivity.
I can't find any SSH configuration settings that would give us this type of behavior. We've tried changing TCPKeepAlive settings on both client and server side, but this just results in a hang.
How immediate? Are very short Client/ServerAlive settings immediate enough? – Kamil Maciorowski – 2019-10-29T17:07:56.103
https://superuser.com/q/911808/54530 https://stackoverflow.com/q/17326918/13317 – Kenster – 2019-10-29T17:55:00.890
Short Alive settings aren't acceptable; we still want SSH to persist during idle periods, but die on loss of network within a couple of seconds. – SixDegrees – 2019-10-29T18:04:34.723