Intermittent SSH failures from Cygwin

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I've hit a problem that only seems to occur when doing SSH from Cygwin
TO a UNIX box (Solaris in this case).

I have a script that makes several connections from Cygwin to Solaris
(e.g. check remote box is running SSH, list files, get files, etc,
etc).  During this process, I occasionally get "ssh: connect to host
solarisbox port 22: Connection timed out" on the Cygwin box.

I guessed this was the Solaris box refusing too many incoming
simultaneous connections. So, I changed the 'MaxStartups' setting in
/etc/ssh/sshd_config from 10 (the default) to 100.  This seemed to
help a bit, but I still got the same message (although less often).

My next guess is that Cygwin has reached it's limit of sockets to
handle connections to the Solaris box.  I know Cygwin uses it's own
Unix API for network stuff , rather than the Winsock API.  However,
I'd rather not recompile SSH.   If this IS the problem, has anyone out
there hit a similar problem & have you managed to tweak Cygwin to
allow more connections? ...or is there some other entirely different
solution I should investigate...?

cygwinbox $ openssl version
OpenSSL 0.9.7b 10 Apr 2003
cygwinbox $ ssh -V
OpenSSH_3.6.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090702f

solarisbox:/ #openssl version
OpenSSL 0.9.7b 10 Apr 2003
solarisbox:/ #ssh -V
OpenSSH_3.6.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090702f

Re: Intermittent SSH failures from Cygwin

I've managed to eliminate the failures by adding...
ConnectionAttempts 10
...setting to /etc/ssh/sshd_config on the Cygwin box.

Normally, SSH only makes 1 attempt to connect & immediately gives up.
This is fine on a reliable fast network.  However, Cygwin goes through
a few loops to makes network connections & occasionally fails if
hammered by connection attempts.  This gets round the problem nicely.

If anyone has any cleaner ways of fixing the underlining problems,
please let us know....

Site Timeline