0

I am trying to make my ssh port in localmachine available in a remoteserver:

localmachine$ ssh -N -R 3333:localhost:22 remoteserver

I expect that localhost:22 (where localhost is as seen by localmachine) will be available in the remoteserver:3333

That means that anybody doing:

anyhost$ ssh remoteserver -p 3333

Would be connecting to my localmachine.

Taking a look in the remoteserver, I see that there is one process bound do 3333:

remoteserver$ sudo netstat -nlp

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address             tcp        0      0 127.0.0.1:3333          0.0.0.0:*               LISTEN      8407/0          

But is is bound to 127.0.0.1 (in the remote server). I have verified this, and tunneling works, but only when I am already on the remoteserver and I do ssh localhost -p 3333.

So localmachine:22 can only be reached on 127.0.0.1:3333 in the remote server, and not on the public interface remoteserver:3333.

Why is that?

What can I do to let port forwarding bind to all interfaces in the remote port?