【问题标题】:Tunelling VNC through two ssh hops通过两个 ssh 跃点隧道 VNC
【发布时间】:2016-02-02 21:30:28
【问题描述】:

我一直在寻找一种解决方案,通过隧道连接到防火墙后面的机器,让 VNC(或其他端口)通过。就像在 old usenet post 中解释的那样,我将在这里回顾一下:

我必须通过中间机器登录,例如:

local $ ssh interim
interim $ ssh remote
remote $ ...any commands...

这很好用。但是现在我正在尝试将一个 vnc 会话从远程隧道传输到本地,但我找不到魔法咒语,使用一两个步骤。

【问题讨论】:

    标签: ssh firewall portforwarding tunneling


    【解决方案1】:

    我最近发现了一个非常简单且适应性强的解决方案:只需通过与防火墙的连接将 ssh 隧道连接到目标系统。像这样:

    local $ ssh -L 2222:remote:22 interim
    interim $ ...no need to do anything here...
    

    在另一个本地控制台中,您连接到 localhost 的 2222 端口,这实际上是您的远程目标:

    local $ ssh -C -p 2222 -L 5900:localhost:5900 localhost
    remote $ ...possibly start you VNC server here...
    

    在另一个本地控制台中:

    local $ xtightvncviewer :0
    

    就这么简单。您可以将所需的任何端口转发添加到第二个命令 (-L localport:localhost:remoteport),就像没有任何中间防火墙一样。例如 RDP:-L 3389:localhost:3389

    【讨论】:

    • 应该可以解决问题:ssh -C -J user@interim user@remote -L 5900:localhost:5900
    猜你喜欢
    • 2020-01-28
    • 2016-09-09
    • 2014-09-03
    • 2013-05-26
    • 2018-09-02
    • 2013-09-28
    • 2012-08-15
    • 2019-01-12
    • 1970-01-01
    相关资源
    最近更新 更多