Solved

ssh tunneling to a terminal services

Posted on 2003-12-11
10
3,275 Views
Last Modified: 2013-11-15
Hello,

I've been trying to ssh tunnel to connect to a machine via terminal services without success.

This is my setup,

From home i'm able to ssh tunnel to a machine at my work network and forward port 80 to my machine at home with no problem.  But now i need to do this for terminal services.

I use cygwin to ssh to a linux server in my network then when i try to forward port 3389 to the terminal service machine and it fails.

on the Linux server i use the following command   ssh -L 3389:localhost:3389  user@linuxserver

Another thing is also that i would have to somehow use a gui so that i can launch the terminal services screen so i've compiled cygwin with xfree86.


Basically i just want to get some suggestions on what would be the correct path for me to do this.

thx
G.

0
Comment
Question by:m3m0
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 9920564
Whew!  You might want to put this into the Linux area if you don't get help here.  Certainly out of my boundary.  Just a thought in case you don't get help, but there are some real good experts here who might join in.

FE  
0
 

Author Comment

by:m3m0
ID: 9920660
Great thank you.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9925434
"i would have to somehow use a gui so that i can launch the terminal services screen so i've compiled cygwin with xfree86."

All you need to do is to enable X forward at both client and server for your secure
shell:

have a look at the following pages about how:
http://www.experts-exchange.com/Operating_Systems/Linux/Q_20667995.html
http://www.experts-exchange.com/Operating_Systems/X_Windows/Q_20700965.html


0
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 9925592
That is what we needed, a Unix Master!  :)

FE
0
 
LVL 4

Accepted Solution

by:
marko020397 earned 125 total points
ID: 9926394
I am using this ssh tunneling for a long time now for terminal services and it works great.

You are not specific in your question how exactly you would like to connect. Let's
asume you are running ssh on some Windows machine in network "one". You want
to connect to another Windows machin in network "two" where you also have a Linux
server.

1. I think the ssh command you are using is wrong. It should be:
   ssh -L 3386:win_server_on_nwetork_two:3389  user@linuxserver
  That way you are connecting to Linux server and make a tunnel to Windows machine.
  As you can see I have changed the first port number. We'll get to that later.

2. Now you have the tunnel from your Windows machine on network one to Linux server.
  That tunnel opens (ends) on Linux server and goes on port 3389 to Windows machine.

3. Now you have to run your Terminal Services Client and connect to localhost on port 3386.
   You may have your own Terminal Services Server on the machine you are connecting
   from. If you use 3389 on both sides of ssh it will conflict with the Terminal Server running
   on machine when ssh is running.

Now a few tricks. How can you connect to localhost:3386.

Windows 2000 and older:
You have to set your terminal services connection to connect to localhost. Then save it and
open the saved file with notepad and change the port to 3386.

Windows XP, 2003:
Windows XP and 2003 do not allow connections to localhost. You need to copy two files
from \Windows\System32 directory to another location. The files are mstsc.exe and
mstscax.dll. Open properties for mstsc.exe on new location and set Windows 98 compatibility
mode. Now you can connect to localhost:3386. You don't have to save the connection in
XP and 2003 you can just specify port along with location. (localhost:3386).

I hope this will help you. If you have any more questions just ask.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 38

Expert Comment

by:yuzh
ID: 9927936
X tunneling also works between *nix and secure shell client for Windows,
(please remember to enable X11 tunneling in your windows ssh client).

If you setup X tunneling properly, the ssh can automatically setup the DISPLAY
value for you. and you can run you GUI app (including your terminal services,
inside the ssh connetion).
0
 
LVL 20

Expert Comment

by:Gns
ID: 9929539
Yes, I think Greg(yuzh) is on to an alternative to markos suggestion here. Instead of going through the hassle of setting up RDP forwarding via the linux box, be sure to install rdesktop on the linux machine, start XWin (at home), ssh -X (to work/linux), rdesktop terminal server....:-)

Slightly cumbersome any way you turn it:-).

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 9929554
rdesktop homepage: http://www.rdesktop.org/

-- Glenn
0
 

Author Comment

by:m3m0
ID: 9957673
Damm all you guys Rock!  I wish i could you all points for just looking at my question :-)  

In any case I was more confortable with Markos suggestion which worked.  BUt i''ll try the rest as well.  So I'll be awarding points to Markos.

Again, I aprecieate all the help and comments.

thanks

-G
0
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 9957714
Speaking for everyone here, am glad we could be of service.  BTW:  your company hiring?  :)  Just kidding.

Have a Happy Holiday Season.

FE
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A list of useful business intelligence software.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now