Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-08-2004, 08:27 PM   #1
LQ Newbie
Registered: Jul 2004
Posts: 15

Rep: Reputation: 0
Remote Desktop using SSH tunnel..... help!

hey all,

I finally got tightvnc working using SSH tunnel... now for the hard part...

I need to be able to remote desktop using SSH tunnel for a laptop running windows XP pro.

I've been reading up on this and I am thoroughly confused..

Client (Putty)
SSHD Server (linux box)
AppServer (XP Laptop, third host)

i have putty setup for tunnelling with tightvnc and it works ok, but i am getting stuck on this... any help appreciated.

Old 08-11-2004, 07:08 PM   #2
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
if you are running putty on Windows OTHER than XP/2003 you just need to setup putty to forward localhost:3389 through ssh tunnel to the XPlaptop:3389
(assuming using default RDP port for XP)
then using MSTSC connect to localhost:3389 and you should be golden

if using XP/putty this is what works for me: copy mstsc.exe and mstscax.dll to a directory somewhere, change the copied mstsc.exe to run in Windows 98 compatability mode and then launch it and point to localhost:3389
(otherwise i would get a message when trying to connect to localhost:3389 about already being connected to this console)

you can setup putty to forward whatever port to the laptop:3389 just as long as you know which port you specify (L3389:laptop:3389 or L6000:laptop:3389, etc) so you use it when connecting to localhost:port to be tunneled through ssh. i use a higher ranged local port and then have it forwarded to my XP:3389 through putty/SSH and it works fine for me

hope this helps

Last edited by gvec; 08-11-2004 at 07:11 PM.
Old 08-11-2004, 07:34 PM   #3
LQ Newbie
Registered: Jul 2004
Posts: 15

Original Poster
Rep: Reputation: 0
different scenario

My fault-- I didn't clarify

XP Laptop is behind router, and so is my linux box

only port open is 22, and want to keep it that way.

how to i forward the traffic coming into the router port 22, then going into my linux box, and make it to the XP laptop ?
Old 08-11-2004, 07:59 PM   #4
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
ok, if you are able to get vnc to work through ssh then you are already able to get into your network behind the router.

the client (the Windows system that is running putty to connect to home linux behind router) will need to be configured to have RemoteDesktop forwarded through the ssh connection established via putty. i use a 'free' port -- lets say 9833 (XP default rdp reversed )

in putty you will need to go to the Tunnels section [Connection --> SSH --> Tunnels] once there you will need to specify the local port that will be forwarded (9833 in this example)

source port = 9833
destination = XPip:3389
local radio button is ticked
then add

now when you establish the ssh connection with your linux box at home anything that hits your client port 9833 will be forwarded through the ssh tunnel to XPip port 3389 (the default XP RDP port)

now that we have the port forwarding established, using Microsoft Terminal Services Client (MSTSC) to connect to XP Remote Desktop is simple

for NON-XP client:
launch MSTSC and for Computer put localhost:9833 (since locally port 9833 will be forwarded through the ssh tunnel to XPip:3389
this will then connect to localhost:9833 which has been setup using putty to be forwarded through the ssh tunnel to your XP laptop ip port 3389

if the client is XP then you will need to copy the mstsc.exe and mstscax.dll and set the copied mstsc.exe to Windows98 Compatability mode, once that is done use the copied mstsc.exe and follow steps for non-xp client (when i tried to connect default xp mstsc to localhost i would get error about already being connected to this console and it would never be forwarded, but copying and setting to 98 compat mode would work without error)

Last edited by gvec; 08-11-2004 at 08:17 PM.
Old 08-11-2004, 08:15 PM   #5
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
you may also find these links helpful

Configuring PuTTY - A step-by-step guide
Old 08-14-2004, 11:51 AM   #6
LQ Newbie
Registered: Jul 2004
Posts: 15

Original Poster
Rep: Reputation: 0
my own stupidity!

Hey guys,

thanks for your help!!!

Guess what... I initially was trying to find a port that Remote desktop would work with over my firewall at work--

they block almost everything over 1000

I forgot that one day I was fiddling with the port number in the windows registry for RDP. I changed it to citrix 1494, thinking that my company would allow that traffic, and never changed it back!! Once I changed the port number, and rebooted, i was golden!

Thanks for your help.

its only a matter of time before i dont use micro$oft !


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
remote desktop,vnc,ssh inside a lan durden2.0 Linux - Networking 3 09-22-2006 03:55 PM
Tunnel all internet traffic through a ssh connected remote computer Bateman Linux - Networking 12 12-10-2004 05:53 AM
'Remote Desktop' with SSH and VNC kaon Slackware 11 09-21-2004 01:15 PM
Putty SSH remote desktop Solved learner_driver Linux - Networking 1 07-05-2004 03:02 PM
ssh forwarding+remote desktop Metroid Linux - Networking 2 06-23-2004 03:14 PM > Forums > Linux Forums > Linux - Newbie

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

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