Hostxpeed
Login Get Started →
Troubleshooting

Fix "Broken Pipe" SSH Error

4 min read
32 views
Jun 12, 2026

What Causes Broken Pipe

Your SSH connection drops due to:

  • Network interruption
  • Firewall killing idle connections
  • NAT timeout on your router
  • Server-side timeout
  • Local computer going to sleep

Fix 1: Keep SSH Connection Alive (Client Side)

Add to ~/.ssh/config:

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 10

Or command line:

ssh -o ServerAliveInterval=60 hxroot@YOUR_IP

Fix 2: Server Side Keep-Alive

Edit /etc/ssh/sshd_config:

ClientAliveInterval 60
ClientAliveCountMax 10

Restart SSH:

sudo systemctl restart sshd

Fix 3: Use Screen or Tmux

Run long processes inside a session that survives disconnection:

# Install screen
sudo apt install screen -y

# Start a screen session
screen -S mysession

# Detach: Ctrl+A, then D
# Reattach: screen -r mysession

Fix 4: Disable SSH Compression

Compression can cause issues on unreliable networks:

ssh -o Compression=no hxroot@YOUR_IP

Fix 5: Check MTU Size

Packet fragmentation can cause disconnects. Test lower MTU:

ping -M do -s 1400 YOUR_IP

If failing, reduce MTU in SSH config:

ssh -o IPQoS=throughput hxroot@YOUR_IP

Was this article helpful?