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.

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.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
Non-working client is .7, server is .5, working client is .2. netstat on the server reports nothing if no session, and "TCP 192.168.1.5:22 192.168.1.2:58716 HERGESTELLT" if working client is at the password prompt. "HERGESTELLT" is German for "ESTABLISHED" in ENGLISH. And note it works fine with the .2 client, so SSH service runs and works I guess. –  TheBlastOne May 22 '11 at 11:58
    
Ah and I saw elsewhere on serverfault that copssh writes into the event log. There are indeed entries for all successful sessions, but none for the failed ones. Log files under var/log are 0 bytes :| And: I do not have any denied-hosts file. –  TheBlastOne May 22 '11 at 12:22
    
See my own answer for the idiotic outcome of my question. Doh! And: Thanks. –  TheBlastOne May 22 '11 at 13:06

I've found it.

Not that I had a good chance since this obviously was logged nowhere, but by verifying my whole IP setup I figured I had an old entry in my faulty client's hosts file (under Windows\System32\drivers\etc). That lead to the actual IP of the server being different from the one reported by DNS, and CheckHostIP was set to YES (of course).

Since the machines have been moved to a DHCP LAN months (!, everything else would be too easy) ago, there is no need (and no allowance) for a fixed IP hosts file. Dropped it -- works.

Damn!

Sorry for asking. And thanks for the answer, even if it was not the solution. (Had I followed the packet sniffing analysis suggestion, I´d found it, too. That is the reason I will accept AntiFubar's answer, not my own.)

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.