Docs / Troubleshooting / How to Fix SSH Broken Pipe Disconnections

How to Fix SSH Broken Pipe Disconnections

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 29 views · 2 min read

Fixing SSH Broken Pipe Disconnections

Frequent "broken pipe" errors or unexpected SSH disconnections to your Breeze are usually caused by idle connection timeouts. Both client-side and server-side settings can prevent these drops.

Client-Side Fix

Edit your local SSH config at ~/.ssh/config:

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 5
    TCPKeepAlive yes

This sends a keepalive packet every 60 seconds and disconnects only after 5 missed responses (5 minutes of true unresponsiveness).

Server-Side Fix

Edit /etc/ssh/sshd_config on your Breeze:

ClientAliveInterval 120
ClientAliveCountMax 3
TCPKeepAlive yes
sudo systemctl restart sshd

Check for Network Issues

Verify there is no packet loss between your machine and the Breeze:

mtr --report --report-cycles 100 your-breeze-ip

If you see packet loss at intermediate hops, the issue is with your ISP or network path rather than the SSH configuration.

Firewall and NAT Timeouts

  • Some firewalls and NAT gateways close idle TCP connections after a set period (often 5-15 minutes)
  • The keepalive settings above send traffic to prevent these timeouts
  • If you use a cloud firewall, ensure it allows established connections to persist

Using Screen or tmux

For long-running sessions, use a terminal multiplexer so your work survives disconnections:

tmux new -s work
# If disconnected, reconnect with:
tmux attach -t work

This ensures no work is lost even if the SSH connection drops unexpectedly.

Was this article helpful?