Richard in Linux 1 minutes

Ssh Connection Broken Pipe

packet_write_wait: Connection to UNKNOWN port 65535: Broken pipe How to fix this annoying ssh connection termination message and stop it happening.

You may discover when connecting via SSH to certain linux machines that after a few minutes the connection freezes or drops losing work and wasting your time.

Luckily there is an easy fix, just open ~/.ssh/config or make a new file with your favourite text editor and put this at the beginning of the file:

Host *
    ServerAliveInterval 120
    TCPKeepAlive no

Nothing more, nothing less.