If you get some kind of network error that breaks your connection, e.g. ECONNRESET, then this error is never printed to stderr. This is of course bad as you don't get any information about what actually went wrong. The reason is that such errors are buffered and are supposed to be printed during cleanup of the connection. However earlier in the cleanup we try to send a disconnect message to the server. This of course fails (since the connection is dead) and the client bails at that point. The last commit that touched this was 23f22a4aaa923c61ec49a99ebaa383656e87fa40, so it might be the culprit. Or the bug might have been around longer. Test case: > [client]$ ssh user@server > [server]$ sudo ss --kill -t 'sport 22' > client_loop: send disconnect: Broken pipe The expected output is: > Read from remote host server: Connection reset by peer