LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   The root cause of the need of ssh keepalives (https://www.linuxquestions.org/questions/linux-software-2/the-root-cause-of-the-need-of-ssh-keepalives-4175554795/)

leniviy 09-29-2015 08:28 AM

The root cause of the need of ssh keepalives
 
Many people complain that their ssh connections are reset after some idle time and the solution is to use ServerAliveInterval on client and ClientAliveInterval on server.

But what is the cause of an idle connection being cut, when keepalives not enabled? Who cuts them? The OS or sshd? Where is it configured?

Habitual 09-29-2015 08:41 AM

On the remote host, look for
Code:

export TMOUT=xx[x]
in ~/.bashrc or other system profile file, or...(.profile, etc.)
Locally, I use
Code:

.ssh/config
Host *
ServerAliveInterval 120
ServerAliveCountMax 30
ConnectTimeout 30

I stay connect for days of 'inactivity'.

Hope that helps.

Another trick is to run something indefinately, like
Code:

watch -n 10 w
and the system thinks you are doing stuff, so TMOUT won't kick in.


All times are GMT -5. The time now is 07:34 PM.