This might be just a misunderstanding of how ssh tunneling works, but here goes:

In my ngirgd.conf file I have the following:

Ports = 6669
Listen =

This ngircd server is running on HostA. I've tunneled into it using the following:

wayne@HostB % ssh -N wayne@HostA -L 6669:HostA:6669

I enter my password. Then inside irssi on HostB, I do:

/connect localhost 6669

And I get

Looking up localhost
Connecting to localhost [] port 6668
Connection to localhost established
Connection lost to localhost

Inside the terminal window where I launched the tunnel, I get:

channel 2: open failed: connect failed: Connection refused

From what I've understood, the ssh tunnel should be connecting HostB:6669 to HostA:6669, so as far as ngirgd is concerned, the connection came from localhost/ But it appears this is not the case - when I forwarded to port 80 it connected to my server just fine.

Am I misunderstanding something, or is something wrong? And how do I fix it?


The ssh manpage mentions your use-case in section "TCP FORWARDING".

Spot the difference? Try this:

ssh -L 6669: hostB

Your IRC daemon listens to on hostb and the host:hostport part of -L port:host:hostpart is relative to the server you connect to. So I guess hostb doesn't resolve to (from hostb), does it? (Thus your command tries to connect to hostb:6669 where no daemon listens.)

  • It appears that the guide I was looking at was full of crap (or, misinformation). I just found the answer here, too. – Wayne Werner Sep 26 '12 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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