1

I am trying to access my work computer (server C) via vnc. I have root on this machine. I can't access it directly so I have to go via server B. I have done the following steps.

First on my local machine I run

ssh -L 5900:serverC:5900 user@serverB

and then on serverC I ran

x11vnc -safer -localhost -nopw -once -display :0

However when I then do

vinagre localhost::5900

on my local machine it says it can't connect.

Both my local machine and serverC are running ubuntu. serverB is running CentOS and I don't have root on it.

What am I doing wrong?

If nothing, what's a good way to diagnose the problem? Is there some way to tell if serverB has port forwarding disabled? Is there a way to do port forwarding in user space?

Simd
  • 967

2 Answers2

1

Look at option #2 in the accepted answer on this related SuperUser question: An SSH tunnel via multiple hops

Option #1 probably won't work for you unless you can send direct traffic from server B to server C outside of an ssh connection.

Option #3 won't work for you because it assumes that you're able to set up an ssh connection directly to server C.

Doug Harris
  • 28,397
0

This works although is a little complicated.

ssh -v -L 1200:serverC:22 user@serverB
ssh -v -L 5900:127.0.0.1:5900 -p 1200 user_from_serverC@127.0.0.1
x11vnc -safer -localhost -nopw -once -display :0
vinagre localhost::5900
Simd
  • 967