Local and remote os are all debian8.
I want to keep ssh alive for long time.
The configuration file /etc/ssh/ssh_config on my client(local) side.

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 10000

The configuration file /etc/ssh/sshd_config on my server(remote) side.

TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 10000

It was tested that ssh connection can keep alive for long time. There is a parameter in /etc/ssh/ssh_config ,ConnectTimeout ,What does it mean?
Do ConnectTimeout 0 or ConnectTimeout 1000 take different effect?


man ssh_config


ConnectTimeout Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout. This value is used only when the target is down or really unreachable, not when it refuses the connection.


How I remember, Connection timeout is a time when server writing for connection if host unreachable. If you fill it by 0 and client will has connection problems server will close connection immidietly when clients connection losts

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.