I’m experiencing quite a number of “Write Failed: broken pipe” errors on Mac OS X to Mac OS X connections. Both machines have OpenSSH 7.1p, and the server is listening on port 1522. Both machines are on the local LAN, but I'm actually connecting through my gateway's public (external) IP. The server is a PowerMac, and it’s public facing for a few people who use it for testing under the PowerPC. The Gateway is using port forwarding to map 1522 to the server.

I’ve tried a few workarounds found in the wild, like ensuring TCPKeepAlive is set to yes in both /etc/ssh_config and ~/.ssh/config. The problem persists, and I’m getting frustrated.

A quick search did not reveal troubleshooting steps for the problem. The search did point me back to workarounds found in the wild, like How to prevent “Write Failed: broken pipe” on SSH connection?. But the workarounds usually lack troubleshooting information.

How can I troubleshoot and diagnose “Write Failed: broken pipe”?

  • re how to avoid a "broken pipe” , don't buck her off high into the air and let her land on it. As for ssh, well, maybe wireshark will give you further hints – barlop Aug 28 '15 at 1:02
  • It might help us to answer your question if you gave an example or two of the sort of command you're running when you get the error. – Scott Aug 28 '15 at 2:55
  • 1
    cant this be a problem of network infrastructure? – Jakuje Aug 28 '15 at 6:13
  • @Jakuje - its on my local LAN. – jww Aug 28 '15 at 16:38
  • @Scott - Configure. I'm trying to build Git for the OS X machine. Its an OS X 10.5 PowerMac, so its missing abut 7 dependencies. I'm trying to get through 8 Configures and 8 Makes. But forgive my ignorance... How does the application layer affect the network layer like this? – jww Aug 28 '15 at 16:40

From personal experience, Write Failed: broken pipe means somehow, somewhere, your connection was dropped. This could be caused by substantial packet loss, a poor Wi-Fi connection, network congestion, or a lot of other things. You could start by trying to connect via the Mac's local IP addresses. If the connection is stable, you know that an external proxy server may be the culprit, though I don't know if your router bounces back connections to it's own external IP address (try traceroute external.ip.address). If this doesn't work, try connecting to another ssh server from another computer, either internal or external. If this works, you know one of your machines is the culprit. If it doesn't, you have a network problem. Just remove a variable at a time from point A to B and you're bound to find the problem. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.