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

How to diagnose a SSH remote port forward not working

· 52CE 我爱测

Using the command ssh -v -R 2255:localhost:2255 [email omitted] I was trying to figure out why remote port forwarding wasn't working until I realized GatewayPorts yes was not present in my host's sshd_config. Once I added that, i…

问题原文

原帖链接 · Chris Stryczynski · CC BY-SA 3.0

Using the command ssh -v -R 2255:localhost:2255 [email omitted] I was trying to figure out why remote port forwarding wasn't working until I realized GatewayPorts yes was not present in my host's sshd_config. Once I added that, it worked successfully.

Is there a way I could have diagnosed this?

The SSH even output the following (without GatewayPorts yes):

debug1: Remote connections from LOCALHOST:2255 forwarded to local address localhost:2255
debug1: channel 0: new [client-session]
debug1: Requesting [email omitted]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email omitted] want_reply 0
debug1: remote forward success for: listen 2255, connect localhost:2255
debug1: All remote forwarding requests processed

社区高分解答

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

When you specify 2255:localhost:2255 fills the missing hostname in front as a localhost. This will really bind only to localhost address (loopback). If you want to use it also "from outside", you need to use the server IP for the remote port forwarding, such as example.com:2255:localhost:2255.

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

资料来源与适用范围

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

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

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