Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I'm having the a bit of a problem with accessing remote RedHat servers from a Windows machine using Cygwin SSH client.

What I do is I run some fairly time-consuming QA scripts on the remote RedHat machine by logging in from home Windows machine. At the client end I use Cygwin SSH in an ordinary Cygwin console window. As long as I'm working interactively (i.e. executing commands from the command line) everything is fine. When I start the script, everything works fine as well as long as the script produces any visible activity on the terminal, i.e. as long as it prints something to the screen. But if there's is a significant pause in the output, the connection to the RedHat machine eventually gets dropped with "Write Failed: Connection reset by peer" message.

Is this some sort of timeout/keep-alive issue? And if so, what do I have to configure to stop this from happening? And where (server side or client side)?

share|improve this question

marked as duplicate by mpy, soandos, gronostaj, tombull89, Mokubai Jun 28 '13 at 22:17

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.

3 Answers 3

up vote 3 down vote accepted

Modify the timeouts:

Configure the server

Open up /etc/ssh/sshd_config and find the ClientAliveInterval option (if it’s not there, add it). The value is in seconds, so I went with 540 seconds, or 9 minutes.

ClientAliveInterval 540

Configure the client

Edit /etc/ssh/ssh_config and find the ServerAliveInterval option (if it’s not there, add it). Again, this value is in seconds, so a 9-minute interval is 540 seconds.

ServerAliveInterval 540

Also, autossh can be your good friend.

share|improve this answer

It most likely is a timeout; to prevent it from occurring, you can use the following setting in ~/.ssh/config

ServerAliveInterval <keepalive-interval>

to send a keepalive packet every <keepalive-interval> seconds.

share|improve this answer

I sure that this and this links will be helpful.

share|improve this answer
    

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