【问题标题】:Putting a port in a remote server SSH tunneling将端口放入远程服务器 SSH 隧道
【发布时间】:2012-04-19 00:20:09
【问题描述】:

我需要知道是否可以通过 ssh 隧道将本地端口放入远程机器

例子

Machine A: port 80 
Machine B: Nothing

在机器 A 内部(很重要,因为 A 可以看到 B,但 B 看不到 A

A>  ssh -f -N -? 80:B:8585 user@B

结果

Machine A: port 80 
Machine B: port 8585 (really A:80)

提前致谢

【问题讨论】:

  • 在我看来,您刚刚定义了 SSH 隧道本身。

标签: ssh tunneling


【解决方案1】:

您需要-R 开关

ssh -f -N -R 8585:localhost:80 user@B

localhost是从A的角度来看的,所以就是将B的8585端口转发到A的80端口。

另请参阅~/.ssh/config 中的RemoteForward 设置。

【讨论】:

    猜你喜欢
    • 2021-05-11
    • 1970-01-01
    • 1970-01-01
    • 2012-10-02
    • 2016-02-13
    • 1970-01-01
    • 2017-06-02
    • 2016-02-06
    • 1970-01-01
    相关资源
    最近更新 更多