I've just set up an SSH server (OpenSSH) on a Windows 7 machine using cygwin and I'm trying to connect to it using PuTTY on a Windows Vista machine but I keep getting Connection timed out. I've checked the network activity on the Win 7 machine with Wireshark and found that I am receiving TCP SYN on port 22 on the Win 7 machine, but the ssh server doesn't seem to reply. I've checked the port number sshd is configured to use, checked my firewall rules and verified that I can ssh localhost (which I can just fine). I have absolutely no idea how to troubleshoot this problem.
Cygwin ssh server is not accepting connections
cygwin;ssh
Related Solutions
Apart from indeed opening up IDENT
port 113 towards the SSH client (so the server can try to connect to that), you might have some luck adding UseDNS no
to sshd_config
.
And I doubt it will help you (the client knows where to find the server, so it's not the 1st bullet, you tried the 2nd bullet, and the delays are longer than 10 seconds so the other bullets don't apply), but for the archives the OpenSSH FAQ states:
ssh(1) takes a long time to connect or log in
Large delays (more that 10 seconds) are typically caused a problem with name resolution:
- Some versions of glibc (notably glibc 2.1 shipped with Red Hat 6.1) can take a long time to resolve "IPv6 or IPv4" addresses from domain names. This can be worked around with by specifying
AddressFamily inet
option inssh_config
. [On the client; AvB.]- There may be a DNS lookup problem, either at the client or server. You can use the nslookup command to check this on both client and server by looking up the other end's name and IP address. In addition, on the server look up the name returned by the client's IP-name lookup. You can disable most of the server-side lookups by setting
UseDNS no
insshd_config
. [On the server, AvB.]Delays less than 10 seconds can have other causes.
- OpenSSH releases prior to 3.8 had an
moduli
file with moduli that were just smaller than what sshd would look for, and as a result, sshd would end up using moduli significantly larger than requested, which resulted in a speed penalty. Replacing themoduli
file will resolve this (note that in most cases this file will not be replaced during an upgrade and must be replaced manually).- OpenSSH releases prior to 3.8 had a flaw in
ssh
that would cause it to request moduli larger than intended (which when combined with the above resulted in significant slowdowns). Upgrading the client to 3.8 or higher will resolve this issue.If either the client or server lack a kernel-based random number device (eg Solaris < 9, AIX < 5.2, HP-UX < 11.11) and no substitute is available (eg prngd) it's possible that one of the programs called by
ssh-rand-helper
to generate entropy is hanging. This can be investigated by running it in debug mode:/usr/local/libexec/ssh-rand-helper -vvvAny significant delays should be investigated and rectified, or the corresponding commands should be removed from ssh_prng_cmds.
Try disabling privilege separation in /etc/sshd_config
Best Answer
You may have Windows Firewall running. Open: Control Panel -> Windows Firewall -> Allow a program or feature through Windows Firewall
Click the "Change settings" button then the "Allow another program..." button. SSHD is probably not in the list that comes up, so use the "Browse..." button to find the binary and click "Open" and then "Add". Mine was in C:\cygwin\usr\sbin\sshd.exe
Somewhere in there you can decide which "Network location types..." you want to use. I left mine with Private checked and public unchecked. I can now login remotely.