2015-11-02 47 views
0

我一直在尋找一種解決方案來隧道到防火牆後面的機器,通過VNC(或其他端口)。在此old usenet post,我會在這裏回顧一下像解釋說:通過兩個ssh hop調優VNC

我必須登錄通過中間的機器,是這樣的:

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

這工作得很好。但是現在我正試圖將vnc會話從遠程隧道傳送到本地,並且無法使用一個或兩個步驟找到魔法咒語。

回答

2

我最近發現了一個非常簡單且適應性強的解決方案:通過連接到防火牆,簡單地將ssh傳送到目標系統。像這樣的:

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

在另一個本地控制檯您連接到本地主機端口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