remote port forwarding is not reachable for != localhost

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
For this problem i didn=B4t find any hints in several newsgroups:

A client C1 connects through SSH to a server with a tunnel
configurationssh -R:6000:localhost:4500 {server ip}=94 :
  On the server the port 6000 forwards to the client C1 on port 4500.

Background: The port 6000 on the server has to forward a stream to the
client on port 4500. So far so good!

Problem: The port 6000 on the server is only reachable locally! This
port is not reachable from a (e.g.) client C2 or Cn from an other
If i=B4m local on the server, and test atelnet localhost 6000=94 the
port forwarding works fine. If I connect from a client C2 withtelnet
{server ip} 6000=94 it doesn=B4t work!

I checked if there is a firewall, but its not. I can reproduce this
case on a current SUSE Linux, as well on Darwin UNIX from my MacBook.

I can bypass that problem with another ssh session: After the first
ssh connect (C1 to server) I connect again within the current session
=93sshgL6001:localhost:6000 localhost=94. Then the port6001=94 =
reachable fromoutside=94, e.g. from client C2.

The parameter-g=94 saysAllows remote hosts to connect to local
forwarded ports.=94 But that works not for the first connect above (C1
connects to server). It works only within a ssh session on the
destination server.

As I said, I can reproduce that on suse linux as well on Darwin OSX.
The bypass with the second ssh connection solves the problem, BUT I don
=B4t like it cause it=B4s a second ssh session. I would like to open the
remote port on the server also for other hosts with one ssh connect.

I hope I described my problem well, I look forward to your hints!

Re: remote port forwarding is not reachable for != localhost

Quoted text here. Click to load it

If you are using OpenSSH server, then this helps in the sshd_config:

# This allows other hosts to connect to my reverse tunnels
GatewayPorts yes

Re: remote port forwarding is not reachable for != localhost

Quoted text here. Click to load it

Yes, it works with that, thanks.
btw, also on Darwin OSX it works fine with that. So I guess with other
linux/unix operating systems it should work similar.

Site Timeline