packet_write_wait: Connection to XXX : Broken pipe

In general, I can connect to a remote machine via SSH without any troubles but occasionally in some particular setup, although I can connect to the remote machine and type commands in a shell, the connection is broken after a few minutes of connection.

This happens when we do not interact with the terminal (i.e., we do not type anything on the keyboard).

In such case, the following error message appears:

A line showing packet_write_wait: Connection to XXX : Broken pipe

Solution:

On the host, add those lines in the file ~/.ssh/config in your home directory

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 5

If the file config does not exist, just create it.

The ServerAliveInternal pings the server with a null packet every 30 seconds. As for the second line, I have not check whether it is required or not.

Please follow and like us:
This entry was posted in Linux and tagged . Bookmark the permalink.

11 Responses to packet_write_wait: Connection to XXX : Broken pipe

Leave a Reply

Your email address will not be published. Required fields are marked *