Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
hello. i want to set up a putty ssh client in a way to tunnel a vnc connection. i want the computer with putty to act as a vnc server. How do i set up the tunnel?
Port 5900, etc...
i know that if i want the putty computer to act as a vnc client, i have to set up the port 5900 and destination "localhost:5900" with option: local
The first thing you have to know is the screen number your vncserver is running on. That is usually :1, but not always. The reason you need to know this is because the server is listening on port 5900+screen number. So to connect to screen :1, you need to tunnel port 5901 and to listen to screen :2, you need to tunnel 5902.
Then to connect through Putty, you usually need to connect to localhost:screennumber. so localhost:1 for screen 1.
I know that port settings. My only question is how to configure putty-tunnel:
When i configure the putty machine as a vnc client, i configure the tunnel like:
Port: 5900
Destination Port: localhost:5900
and a "x" on local.
Then i type in vncviewer: localhost:5900 and it works.
Now if i want to do the opposite, how can i configure it? I guess my "x" will be on remote... Then, i guess the port will be the same or 5901 or 5902... ok. And what about the destination Port? also localhost:5900 or the ip address from the ssh-server that wants to run a vnc viewer? and on the ssh server which runs the vnc viewer: how do i configure the vncviewer? on localhost or on serverīs ip?
OK, I think I know where you're confused. Lets assume that vncserver on the remote box is on screen 1, so we're using port 5901. In Putty, you want the local port to be 5901 and the remote port to be 1.2.3.4:5901 only replace 1.2.3.4 with the LAN IP address of the remote machine.
So on my network, I have an IP address from my ISP (the WAN IP) and my Linux box has an LAN IP address (192.168.1.50) that is non-routable. So to make the SSH connection, I connect to the WAN IP address (which is forwarded to my Linux box) but to make the tunnel I use the LAN IP address. So on my Putty, the Destination port is 192.169.1.50:5901. If the ssh connection is OK, I then fire up a VNC client (on the local machine) and point it at localhost:1 and the connection is made.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.