Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • I think a high ServerAliveCountMax is also needed in order for this to be as reliable as possible. And if both ServerAliveInterval and ClientAliveInterval are set low enough, I don't think there will be any need for TCPKeepAlive. Additionally, if there are any middleboxes, they can still lose state even with all of the previously mentioned settings configured exactly correct. It may help to use MPTCP (if both client and server support it). Commented May 4, 2015 at 20:28
  • 1
    It's not clear at the start whether you mean config on the client side or server side (eventually I conclude, client side). Then at ServerAliveInterval description, you say "client will send... to the server", but in the next paragraph "NULL packet is sent by the server to the client". I find these a bit confusing. Commented Jun 11, 2017 at 7:23
  • 1
    After adding to the server I get: /etc/ssh/ssh_config: line 57: Bad configuration option: clientaliveinterval /etc/ssh/ssh_config: line 59: Bad configuration option: clientalivecountmax Commented Jul 29, 2017 at 15:57
  • 6
    @Anders You get the error because ClientAliveInterval and ClientAliveCountMax are ssh server options, thus meant for sshd_config and not ssh_config Commented Jul 30, 2017 at 8:11
  • 2
    @chandresh you don't have to. After modifying ssh_config the new sessions will read that file. The /etc/environment file is a different thing which has the format of VAR="value" without spaces thus VAR = "value" would be invalid. Sourcing /etc/ssh/ssh_config that way will i.e read: Port 22 or Host * which will treat these as commands Commented Aug 14, 2019 at 12:38