Joined March 2012
·

Luke Griffiths

Cambridge, MA
·
·

Posted to SSH Broken Pipe fix (Mac OS X) over 1 year ago

Thanks for the fix. Do you have understanding to provide a little background on why these settings fix the problem?

edit: after a little research:

ServerAliveInterval 120 means "If there is no activity for 120 seconds on the connection, send a request to the server, requesting a response." I believe this is useful because some servers are configured to drop inactive ssh sessions. This keeps the connection active so that doesn't happen.

TCPKeepAlive no means "do not send keepalive messages to the server". If the converse, TCPKeepAlive yes, were set, then the client sends keepalive messages to the server and requires a response in order to maintain its end of the connection. This will detect if the server goes down, reboots, etc. The trouble with this is that if the connection between the client and server is broken for a brief period of time, this will cause the keepalive messages to fail, and the client will end the connection with "broken pipe".  

Setting TCPKeepAlive no tells the client to just assume the connection is still good until proven otherwise by a user request, meaning that temporary connection breakages while your ssh term is sitting idle in the background won't kill the connection.

Achievements
69 Karma
0 Total ProTip Views