Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

marked as duplicate by jasonwryan, sr_, Mat, Michael Mrozek May 22 '12 at 13:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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