4

I'm trying to setup a Remote Forward from my AMAZON instance to my local machine (dev) My problem is that when I connect to amazon server and when I run the netstat -antp command it shows me that I have a socket listening on the 127.0.0.1:8080 only however I want it to listen to the public interface.

Output of my "netstat -antp | grep LISTEN":

[centos@ip-##-##-##-## ~]$ netstat -ant
Proto Recv-Q Send-Q Local Address           Foreign Address         State           PID/Program name    
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      -       

I tried the RemoteForward option with :

[PUBLIC_IP]:8080 
[AMAZON_INTERNAL_IP]:8080
0.0.0.0:8080

This is the content of my .ssh/config file:

Host amazon
    User centos
    HostName ###.###.###.###
    RemoteForward  8080 127.0.0.1:81
    IdentityFile ~/.key.pem

Thanks for your help !

M. Gara
  • 163
  • 1
  • 2
  • 10

1 Answers1

5

You need to write public IP address on the RemoteForward option line:

RemoteForward  8080 ###.###.###.###:81

also you need to specify GatewayPorts yes in the server configuration and restart sshd service.

huyz
  • 120
  • 3
Jakuje
  • 9,715
  • 2
  • 42
  • 45