How to use vnc to connect remote server with GUI desktop

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.

asked Sep 27, 2016 by harryxiyou (5,830 points)

1 Answer

 
Best answer

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

Note:
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.

answered Sep 27, 2016 by harryxiyou (5,830 points)
edited Sep 27, 2016 by harryxiyou

Great tips!

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/ ).

commented Sep 27, 2016 by Eric Z Ma (44,280 points)

Yes, It should be '5901'. I have fixed it. Thank you.

commented Sep 27, 2016 by harryxiyou (5,830 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...