The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Email Subscription

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 717 other subscribers

How to Keep Alive SSH Sessions (getting rid of the “Write failed: Broken pipe”)

Posted by jpluimers on 2014/01/25

Getting rid of the dreaded “Write failed: Broken pipe”.

Note the difference of ServerAliveInterval/ServerAliveCountMax and ClientAliveInterval/ClientAliveCountMax.

For Mac, Linux and CygWin:

To enable the keep alive system-wide (root access required), edit /etc/ssh/ssh_config; to set the settings for just your user, edit ~/.ssh/config (create the file if it doesn’t exist). Insert the following:

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

You can also make your OpenSSH server keep alive all connections with clients by adding the following to /etc/ssh/sshd_config:

ClientAliveInterval 300
ClientAliveCountMax 2

–jeroen

via: How to Keep Alive SSH Sessions.

Leave a Comment