LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2005, 09:29 AM   #1
jr0
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian Etch
Posts: 14

Rep: Reputation: 0
setting up ssh tunnel for vnc


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

But this doesn't work for being a server...

thanks
 
Old 10-21-2005, 12:16 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
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.
 
Old 10-22-2005, 10:37 AM   #3
jr0
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian Etch
Posts: 14

Original Poster
Rep: Reputation: 0
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?

Thanks again.
 
Old 10-22-2005, 12:38 PM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tunnel vnc through openssh disorderly Linux - Security 9 08-22-2005 03:56 PM
SSH tunnel reversed for VNC...Possible? silence Linux - Networking 1 07-22-2004 10:42 AM
VNC with Putty Tunnel port ziggie216 Linux - Software 10 12-02-2003 09:32 PM
VNC with Putty Tunnel LinuxHaven Linux - Security 15 08-30-2003 02:16 AM
VNC and SSH Tunnel Syncrm Linux - General 13 04-06-2003 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration