3

When I create a remote port forwarding tunnel with Putty, a remote port opens on interface with ip 127.0.0.1. On the remote host I'm able to nc localhost RPORT and forwarding works, but I'm unable to connect with nc RHOST RPORT. The problem is, that RPORT gets open on wrong interface -- localhost, instead of the public IP interface.

How can I setup remote port forwarding, so that I can connect from the internet, to RHOST:RPORT?

On RHOST, netstat -an | grep RPORT returns tcp 0 0 127.0.0.1:RPORT 0.0.0.0:* LISTEN

1
  • @DmitriChubarov: I think you are confusing local forwarding with remote forwarding. Setup on your image would forward local port 3128 to a remote port proxy:3128. My problem is with remote -> local.
    – qwe
    Nov 8, 2012 at 18:23

1 Answer 1

2

GatewayPorts needs to be set to on in sshd_config for the far side to allow others to connect to the forwarded port or you need to check 'Remote ports do the same (SSH-2 only)' in the PuTTY GUI to request that setting of the session.

If you wanted to forward from other hosts via PuTTY you need to check the 'Local ports accept connections from other hosts' setting.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .