0

This is a commonly asked, and answered question. However, the solutions are not working for me, so I'd like a little help figuring out why not. I know I have done this successfully in the past.

I've looked at: VNC tunnel via SSH connection

VNC tunnel via SSH connection

http://crl.ucsd.edu/handbook/vnc/

http://martybugs.net/smoothwall/puttyvnc.cgi

I have PUTTY configured as follows:

enter image description here

I open the connection to serverA. Then

ssh -L 5901:localhost:5901 serverB

Once logged in I start a VNC session

-bash-4.1$ vncserver :1

New 'serverB:1 (balter)' desktop is serverB:1

Starting applications specified in /home/users/balter/.vnc/xstartup
Log file is /home/users/balter/.vnc/serverB:1.log

-bash-4.1$

I should be good to go, so I try to VNC to localhost or localhost:0 or localhost:5900. The connection fails.

Suggestions?

EDIT: I should have added that serverB is behind a firewall, so I need to use serverA as an intermediary.

EDIT 2 -- based on Nikita's comment: Output of netstat -inpt on serverB

-bash-4.1$ netstat -inpt
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
bond0      1500   0 25034847553      0      0      0        0      0      0      0 BMmRU
eth0       1500   0  7645087      0      0      0   148398      0      0      0 BMRU
eth4       1500   0 10494292891      0      0      0        0      0      0      0 BMsRU
eth5       1500   0 10644409020      0      0      0        0      0      0      0 BMRU
eth6       1500   0 14540554669      0      0      0        0      0      0      0 BMsRU
ib0        1500   0     5055      0      0      0     4267      0      1      0 BMRU
lo        65536   0 8932391289      0      0      0 8932391289      0      0      0 LRU
-bash-4.1$

How do I interpret this?

1 Answer 1

0

Didn't you forget to click "Add" button in screenshoted dialog, to actually add forward specification into list?

Are you sure your latest remote server uses 5901? It seems it should, but check this with netstat after you run vncserver.

It could be better to use only one forward. Forward not to localhost, but to serverB right in the Putty dialog. You will only need to connect to serverB via SSH to run vncserver there, no need to forward anything. Of course, serverB's vncserver shouldn't only listen on localhost. (SSH forwarding code resolves names on server, so serverB should be resolvable only on serverA, even if you use its name in the Putty dialog).

4
  • I've definitely added the tunnel in Putty. Good question about 5901. How would I check? I'm updating my question in regards to the last comment. ServerB is behind a firewall. I need to access it by tunneling through serverA.
    – abalter
    Dec 6, 2015 at 17:41
  • Run netstat -lnpt to view tcp listeners. You'll see which port vnc server occupied. Dec 6, 2015 at 17:50
  • See netstat output added to question. Not sure how to interpret.
    – abalter
    Dec 7, 2015 at 5:37
  • I started the vnc session with vncserver :1, so doesn't that automatically mean it is on 5901?
    – abalter
    Dec 7, 2015 at 5:43

You must log in to answer this question.

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