Ssh – copssh: SSH “connection refused” on one machine, successful on others

copsshopensslsshwindows-xp

While I can connect from a client to the server (openssh <servername> prompts for login info), I get "ssh: connect to host <servername> port 22: Connection refused" on another one.

Being not a UNIX wizard (thus: sorry for all the wrong or missing terms in this question), I am using unison to synchronize file system branches. unison uses an ssl tunnel via ssh. That´s why I have copssh running on the server (XP) and also on the client (to have a good ssh client).

The machine that fails has a fresh install of copssh. All machines are running XP. I tried shutting down all local firewalls, and have been looking around in openssl and ssh config files, but I am totally lost in finding the cause. I don't even find a useful log, or something. The event protocol of Windows' on the server does not contain any entry during the failed connect process.

How can I diagnose this? I really want to fix this.

The LAN is using an N300 sireless router model WNR2000v2. The "faulty" client is on wired LAN, the working one on wireless. It still works, however, if I take the working client into the wired LAN (I've checked this). There is no port 22-blocking rule anywhere.

I have browsed all related questions, but found nothing really comparable except for answers that cover possible causes I have already verified.

Best Answer

A connection refused usually means two things. Either there is a firewall blocking the connection (it may be a network firewall along the path or a host firewall) or the port is not open on the host you're trying to connect to.

According to what you say there is no firewall, so you should would, firstly, check if the port is really open on the host. Do a netstat -n -p tcp and check if the ssh port is listening. You should see a line like this:

TCP 0.0.0.0:22 0.0.0.0:0 LISTENING 2518

If you don't then that means that, for some reason, the SSH service has not started and you should check copssh's logs. The logs might not be in the event viewer, you should also check on the program's directories.

If you do see the SSH port listening, then something is blocking you. You should run a Wireshark and check if the intended traffic is reaching your host and try to find where along the path is blocked.