cygwin - Enable ssh connection on windows server 2008
2014-07
I am trying to ssh in windows to some windows server 2008 using cygwin but I got following error:
$ ssh -v [email protected]
OpenSSH_6.6.1, OpenSSL 1.0.1h 5 Jun 2014
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to 172.26.33.203 [172.26.33.203] port 22.
debug1: connect to address 172.26.33.203 port 22: No error
ssh: connect to host 172.26.33.203 port 22: No error
I am beginner here, so can anyone tell me how to fix this error
I installed sshd on my cygwin, and I tested it on the local machine which works fine.
- sh-host-config -y
- cygrunsrv -S sshd
But when I try to login from my Mac, I can't login to the cygwin. The debugging message is as follows.
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009 debug1: Reading configuration data /etc/ssh_config debug1: Connecting to smchopc [192.168.1.106] port 22. <-- It takes a while debug1: connect to address 192.168.1.106 port 22: Operation timed out ssh: connect to host smchopc port 22: Operation timed out
What might be wrong?
PS: Actually I have another question list of http://superuser.com/questions/110160/ssh-to-cygwin-is-slow-to-respond , and in this case, the connection is very slow both for local connection and external connection. With the question for this thread, the local connection is very fast and working whereas external connection is not possible.
Both are the same Windows 7, and I installed the same cygwin. I don't understand what makes this difference.
You could have a firewall blocking port 22. Run a port scan on the machine you're trying to use and see if it's open.
In both this question and that other, your logs show private IP addresses. However, the addresses, 10.0.40.177
and 192.168.1.106
, are in different ranges, so I assume you're mixing multiple routers? (Like maybe a wired router and a wireless router?)
If so, then you might be suffering from Double-NAT problems then. I'm not sure if SSH would be affected by that. But as a start: for an AirPort router, Apple describes how to validate and fix that in some support article:
here is a simple way to tell if your computer is on a "double NAT" network:
- In Finder, from the Go menu, choose Utilities.
- Open Network Utility.
- Click Traceroute.
- In the field, enter "www.mac.com".
- Click Trace.
After starting the trace, look for the line beginning with the number 2.
If the address in that line is any IP address in either of the following ranges:
10.x.x.x
192.168.x.x
... then your network has multiple layers of NAT.
Like described in that same support article: to fix this, you would need to put the "slave" router (most often the wireless router) into "bridging mode".