大网数据广告活动
服务器运维问答

SSH Remote forward with ssh config file not Listening to all Addresses (Listening to local host only)

· 52CE 我爱测

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 …

问题原文

原帖链接 · M. Gara · CC BY-SA 3.0

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 !

已采纳解答

原帖链接 · Jakuje · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-12-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。