I can't login cygwin/ssh from Mac

1

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 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.

prosseek

Posted 2010-02-19T04:38:22.070

Reputation: 4 635

When you say "try to install from my Mac" what do you mean? You're trying to ssh into your local machine? I'm assuming you're on a local network with the machine. – Josh K – 2010-02-19T04:45:05.627

Oh, I changed it from 'install' to 'login', sorry about the confusion. – prosseek – 2010-02-19T16:29:56.423

Answers

3

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.

Josh K

Posted 2010-02-19T04:38:22.070

Reputation: 11 754

1

Yes, you are correct. With the help in http://maximumpcguides.com/windows-7/open-a-port-in-windows-7s-firewall/ I could make it work. Thank you!

– prosseek – 2010-02-20T01:20:51.520

Yes, absolutely, actually, I even didn't know about the 'acceptance' of answer system. Thanks again. – prosseek – 2010-02-20T17:22:20.380

0

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:

  1. In Finder, from the Go menu, choose Utilities.
  2. Open Network Utility.
  3. Click Traceroute.
  4. In the field, enter "www.mac.com".
  5. 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".

Arjan

Posted 2010-02-19T04:38:22.070

Reputation: 29 084

@Arjan: Actually, one Win7 machine is my home PC, and the other one is for my office work. After fixing the not-login problem with port 22 open, I see the login speed is not bad, even though it's not an instant login. – prosseek – 2010-02-20T01:47:24.957