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?

2
  • I think it should be vinagre localhost::0. To my knowledge, the command line for vnc clients takes a display number and maps it to a port number by adding 5900 to it.
    – Joseph R.
    Apr 17, 2013 at 23:32
  • @JosephR Thanks. That's not the problem sadly.
    – Simd
    Apr 18, 2013 at 7:23

2 Answers 2

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.

1
  • Thanks. The problem is that 5900 is blocked on serverC it seems. I found way round it though.
    – Simd
    Apr 18, 2013 at 7:57
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 [email protected]
x11vnc -safer -localhost -nopw -once -display :0
vinagre localhost::5900

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .