[ssh] ssh keep-alive tip
1. ssh -o TCPKeepAlive=yes mark@localhost
or
2.
Remember that
ServerAliveIntervalis limited by
ServerAliveCountMaxand that
ServerAliveCountMax
is set to 3 by default!That is, if you set
ServerAliveInterval
to 60 andServerAliveCountMax
is left to default value (3), after the client has sent 3 keep alive packets it will disconnect. That makes 60 x 3 = 180 seconds.So if you want more time away, you set
ServerAliveInterval
to 60 andServerAliveCountMax
to the numer you want (for example: 100). The client will send one keep alive packet every 0 seconds for 100 times or, if you prefer, 100 keep alive packets, one every 60 seconds.![]()
You set this up in your
$HOME/.ssh/config
file.Most of these options are explained in
man ssh_config
.Thanks a lot to Cam for pointing us all in the right direction!!!!