I know that this is a common problem with a known solution. A quick web search tus up many results that point you toward the ServerAliveInterval (or less commonly the server-side ClientAliveInterval) configuration options. Setting one of these to some arbitrary value such as 15, 60, or 120 will solve the broken pipe issue.
My question is why? Why does this happen in the first place? Who is closing the socket?
I have my doubts about the OS killing the connection due to inactivity, given the fact that the TCPKeepAlive option is enabled by default, which causes TCP keepalive messages to be sent in order to detect clients dropping offline. So the OS won't see the connection as inactive anyway.
In that case, is it the sshd itself that is timing them out? And if so, why isn't that timeout documented or configurable? And if application-level keepalives are needed to keep SSH connections open, then why are they not enabled by default?
These questions are invariably overlooked whenever this issue pops up on discussion forums. Can anyone shed some light on this?
Recent Questions...