3

Possible Duplicate:
What does the Broken pipe message mean in an SSH session?

I run a program on server with SSH ! the program runs normaly and after a period of time i receve a message Write failed: Broken pipe and the program stops.

What does this mean please ? and what is solution ?

I read in : What does the Broken pipe message mean in an SSH session?

That i can overcome this problem to update my server (and restart your sshd)

echo "ClientAliveInterval 60" | sudo tee -a /etc/ssh/sshd_config

Or client-side:

echo "ServerAliveInterval 60" >> ~/.ssh/config

But how to make it unlimited ? not only 60 seconds !

Thanks

user15992
  • 687
  • 3
  • 8
  • 12

2 Answers2

7

Try man sshd_config and man ssh_config.

ClientAliveInterval

Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.

and

ServerAliveInterval

Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server, or 300 if the BatchMode option is set. This option applies to protocol version 2 only.

I would avoid using,

echo "ClientAliveInterval 60" | sudo tee -a /etc/ssh/sshd_config

personally. The seems like a clunky and risky way of updating sshd_config. I would just sudo vi it, and see what the existing setting for ClientAliveInterval is, if present.

Finally, I believe you're misreading what those settings do. They don't drop the connection after that time, they send a keep alive message after that time to encourage both ends of the connection, and any firewalls in between, to believe the connection is still active and should be kept open.

EightBitTony
  • 21,373
1

If you keep experiencing this problem, I suspect that your network connection is unstable and maybe you should look for stability issues on your side - maybe you're on a Wifi with low signal strength.

A great way to avoid the program being stopped is using a terminal multiplexer like GNU Screen or tmux. They open a background session on your server which won't close if you lose connection or log out - you can always re-attach to those sessions once you reconnect to your server.

adi64
  • 31