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 = 127.0.0.1
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 [127.0.0.1] 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/127.0.0.1. 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?