For my case, I need to bypass one intermediate server so that I can connect to the remote server with vnc. For example, there are two servers (s1, s2) except my local PC and I have to login to s1 so that I can login s2 from my local PC. However, now, I need to use vnc to connect to s2 from my local PC.
In s2 side:
$ vncserver :1
In local PC:
$ ssh -L 5901:10.80.1.1:5901 -l username -f -N afsconnect2.njit.edu $ vncviewer localhost:590x
1, afsconnect2.njit.edu is s1 server.
2, 10.80.1.1 is s2 server.
3, Remember to change to vnc session number if “:1” has been taken.
I guess the ‘590x’ should be ‘5901’ as the vncserver is created with ‘:1’.
And for the background info, the tip is using the “Local port forwarding” function of SSH tunnels (an intro at http://www.systutorials.com/39648/port-forwarding-using-ssh-tunnel/ ).
Yes, It should be ‘5901’. I have fixed it. Thank you.