Killing dead ssh connections
by TNFinfan from LinuxQuestions.org on (#4S70Q)
I have a monitoring app that utilizes ssh keys to ssh into our linux hosts to run various commands. We have noticed that with some regularity, even though the ssh processes seem to work fine, we are getting open ssh connections that are no longer active.
We are trying to find a way to tell if the connections are still be used in order to terminate them.
I know we could modify the sshd_config directives as follows...
ClientAliveInterval 300
ClientAliveCountMax 0
But we don't want to affect interactive sessions. We only want non-interactive sessions that can easily be identified by the username.
Any ideas?


We are trying to find a way to tell if the connections are still be used in order to terminate them.
I know we could modify the sshd_config directives as follows...
ClientAliveInterval 300
ClientAliveCountMax 0
But we don't want to affect interactive sessions. We only want non-interactive sessions that can easily be identified by the username.
Any ideas?