Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have configured SSHD using Cygwin on Windows 7. I have checked and double-checked all of the following points:

  • Port forwarding is correctly configured
  • Windows Firewall is configured to pass port 22
  • Local login attempts (using Cygwin SSH) succeed
  • sshd_config has UseDNS No
  • Using nmap from remote machine confirms port 22 is accessible
  • /etc/passwd and /etc/group are correctly populated

However, remote login attempts time out. This includes from the local network.

user@host:~$ ssh -vvv user@the.ip.add.ress
OpenSSH_5.5p1 Debian-4ubuntu6, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /home/user/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to the.ip.add.ress [the.ip.add.ress] port 22.
debug1: connect to address the.ip.add.ress port 22: Connection timed out
ssh: connect to the.ip.add.ress port 22: Connection timed out

No messages are logged to /var/log/sshd.log. I suspect that there is a permissions issue with a particular file somewhere, however I have checked the permissions of all my Cygwin binaries, DLLs and the particular files important to Cygwin sshd, including all of:

  • /etc/passwd
  • /etc/group
  • /var
  • /var/log/sshd.log
  • /var/empty

Others who have reported this or similar errors appear to have missed one of the points enumerated above. Can anyone point me to a possible solution?


As requested, the netstat output, with sshd running.

>netstat | find "22"
    TCP    [::1]:24499            Hostname:ssh          TIME_WAIT

Disabling IPv6 doesn't change anything. But I noticed some debug output from sshd which might be relevant:

debug2: fd 3 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 22 on
Server listening on port 22.
share|improve this question
Can you open an SSH session locally? (For example, from within Cygwin.) –  jaume Nov 19 '12 at 13:26
Yes, the third bullet in the first list. I've made it more clear, thanks. –  reve_etrange Nov 19 '12 at 20:27
Is there any difference when ssh'ing from you home network and from an external network that is forced to use port forwarding? If none of them work, we have a firewall problem. If only the former works port forwarding is the culprit. Could you try this? Start sshd in debug mode like this: sshd -d -d -d -p 22. What happens when you do telnet the.ip.add.ress 22 from your home network and from outside your local network? Does sshd log something to the console? –  jaume Nov 19 '12 at 21:12
Changed owner of /var/empty to run sshd in debug mode. Connection from LAN times out, nothing logged. Connection from localhost succeeds with appropriate console messages. –  reve_etrange Nov 20 '12 at 2:09
If you stop the Windows firewall, does it work? –  jaume Nov 20 '12 at 5:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.