0

I set up a ssh server through ssh-host-config. Then I started the server.

net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.

When I try to connect I get:

ssh myusername@localhost
ssh: connect to host localhost port 22: Connection refused

I tried to allow port 22 in Windows Firewall, but that didn't change anything. And because I'm trying to ssh locally I don't think Windows Firewall is the culprit.

I'm using Windows 7 and

What should I look for to fix this problem?

4
  • Enable telnet command and checking with telnet localhost 22?
    – quanta
    Jul 28, 2011 at 17:16
  • Can you post the output from 'netstat -an | grep 22' Jul 28, 2011 at 17:24
  • @EightBitTony: the original poster is using Windows 7, he should use findstr instead of grep.
    – quanta
    Jul 29, 2011 at 2:39
  • $ netstat -an | grep 22 TCP 127.0.0.1:62522 0.0.0.0:0 LISTENING TCP 192.168.1.4:51585 65.222.174.80:80 ESTABLISHED Jul 29, 2011 at 6:27

2 Answers 2

1

From the netstat output (which you might want to move into your question), the SSHD daemon is not listening on port 22. Which probably means although it started, it then crashed or stopped.

Try running sshd -d -d

That will run sshd in the foreground with debugging turned on, and you can see if / why it's crashing.

0

It is clear from the netstat output that either sshd is not listening on port 22 or the service is not running (crash on start). Best place to look for in windows would be event viewer in control panel. Also in the services.msc, see if it logging. If it is logging , logs would tell you what is happening and hence you would find the fix. Open resource monitor and see if the process sshd is running.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .