【问题标题】:ssh portforwarding unixssh 端口转发 unix
【发布时间】:2012-03-22 22:38:40
【问题描述】:

我正在尝试使用本地端口转发来通过防火墙访问远程主机,并且可以使用以下命令来实现。

ssh -L 23456:remotehost:10000 localhost

>telnet localhost 23456
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.


>telnet 170.19.120.207 23456
Trying 170.19.120.207...
telnet: connect to address 170.19.120.207: Connection refused
telnet: Unable to connect to remote host: Connection refused

看起来端口转发发生在环回上,任何带有主机名的东西都被拒绝了。有人可以帮我解决这个问题,因为我确信有/应该有办法

【问题讨论】:

  • 不是编程问题。标记为移至 ServerFault。

标签: unix ssh


【解决方案1】:

似乎它工作正常'telnet localhost 23456'工作!

telnet 170.19.120.207 23456 不应该工作,除非 170.19.120.207 指向您的主机。如果您需要启用网关功能:

ssh -g -L 23456:remotehost:10000 localhost

【讨论】: