# SSH tunnel, "connection refused" (SOLVED)

## knifeyspoony

Hi,

On the client side, I'm using OpenSSH under Cygwin.  I issue ssh -f -N -L 23900:remotehost.com:23900 remotehost.com.  I successfully authenticate on my Gentoo server machine.  But when I try to use the forwarded connection at localhost 23900, I get "connection refused".

I've verified that the server process is running and listening on 23900.  I am able to connect to the server from the Gentoo terminal.  My sshd_config has AllowTcpForwarding and GatewayPorts set to "yes".  I don't have a firewall running on the server side, unless it's part of Gentoo's default installation.  (iptables certainly isn't running.)  tcpdump confirms that the traffic is reaching Gentoo.

What could be the problem here?  Would the router that's on my server's network be an issue?

Thanks.Last edited by knifeyspoony on Fri Jul 27, 2007 9:46 pm; edited 1 time in total

----------

## Voltago

To what ip address does localhost resolve to? In other words, does 127.0.0.1:23900 work? Perhaps leave out the '-f' option to prevent the forking of ssh into the background to get some feedback about what is wrong.

----------

## knifeyspoony

Thanks for the reply, but it seems pretty clear to me that if anything of interest is happening it's happening on the server side.  The connection request is reaching the server and the server is rejecting it.  

If the rejection is logged on the server side, I don't see where.  There's no filename containing "ssh" in /var/log, and sshd isn't printing anything to 'messages'.

----------

## Rob1n

Have you tried doing the tunnel as:

 *Quote:*   

> 
> 
> ssh -f -N -L 23900:localhost:23900 remotehost.com
> 
> 

 

It may be that your server process is only listening on localhost (or has some sort of access restrictions).

----------

## knifeyspoony

Brilliant, thank you.

----------

