Try:
x11vnc -safer -localhost -nopw -once -display :0 #Run manually on system_C
& on local system,
ssh -t -L 5902:localhost:5901 user_B@server_B 'ssh -t -L 5901:localhost:5900 user_C@server_C' &
#Note: Enable password-less (key based) authentication from "your_pc -> servB" & "servB -> servC"
vncviewer localhost:2 #Run on local system
NOTE: If the commands fail, please try changing the port numbers. In this example, I am trying to tunnel it as below:
your_PC:5902 <-> server_B:5901 <-> server_C:5900
I have not tested this 2 level chain (I do not know if x11vnc's -display
parameter works across ssh, but I think, it should.):
#Run both lines on local system
ssh -t -L 5902:localhost:5901 user_B@server_B "ssh -t -L 5901:localhost:5900 user_C@server_C 'x11vnc -safer -localhost -nopw -once -display :0'" &
vncviewer localhost:2
EDIT: To accomodate this:
yes that's it. But annoyingly servB -> servC has port 5900 blocked. – Anush
#Run both lines on local system. This may be overhead, but should work.
ssh -t -L 5902:localhost:5901 user_B@server_B "ssh -t -L 5901:localhost:1200 user_C@server_C 'ssh localhost -L 1200:localhost:5900 & x11vnc -safer -localhost -nopw -once -display :0'" &
vncviewer localhost:2