LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2011, 05:33 PM   #1
black hole sun
Member
 
Registered: Jul 2004
Distribution: Slackware Current
Posts: 127

Rep: Reputation: 15
Connect to windows desktop behind linux server?


Hi guys,

I want to remote-desktop into a windows box that happens to be hooked up to a linux server. The linux server uses a static IP.

I've already enabled remote-desktop on the windows machine, but am wondering what I need to do server-side to make the server's ip forward to the windows machine. I know this can be done with iptables but I'm not sure how to work it.

I believe I opened port 3389 - but I'm not sure that's enough.

Thanks for any help.

Last edited by black hole sun; 01-21-2011 at 05:35 PM.
 
Old 01-21-2011, 06:07 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You will need a remote desktop client that it is capable of speaking Windows Terminal Services protocol. Check out this one called rdesktop, which claims to have this functionality.
 
Old 01-22-2011, 03:54 PM   #3
black hole sun
Member
 
Registered: Jul 2004
Distribution: Slackware Current
Posts: 127

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Noway2 View Post
You will need a remote desktop client that it is capable of speaking Windows Terminal Services protocol. Check out this one called rdesktop, which claims to have this functionality.
I only need to access it from windows, windows-to-windows. I just need to set up the linux server to forward incoming connections to the computer it's attached to. Do I still require rdesktop on hte server...?
 
Old 01-22-2011, 04:38 PM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
I read your post backwards. I thought you meant you wanted to view the Windows desktop remotely. If you wish to view the Linux desktop on Windows, there are several ways you can do this. VNC is one of the most common methods, but by default it does not use a secure connection so you will want to tunnel it over an SSH connection. The way that I have had the most success with is FreeNX. You can even use x-forwarding over SSH and use a program like Cygwin on the Windows machine.

The "remote desktop" options on Linux and Windows speak different protocols. Consequently, you need a third party tool to go between the two of them. Once you have the tool working, I would suggest turning off "remote desktop" or at least putting your firewall in front of it to prevent unintended access to your system. Also, it goes without saying, use either RSA keys or very strong passwords for this feature. One last thing, beware of uPnP on your router. If you have a remote desktop application with uPnP enabled, you could have an unsecured open port without even realizing it.
 
Old 01-23-2011, 06:47 AM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,553

Rep: Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834Reputation: 2834
I think the OP is simply needing to set up port forwarding to a Windows box behind a Linux server.
This requires two iptables rules:
1) A rule to accept incoming requests to port 3389 e.g.
$IPTABLES -A INPUT -i $EXTIF -p tcp -s $EXTNET1 --dport 3389 -j ACCEPT
and
2) A rule to forward the request to the target Windows box e.g.
$IPTABLES -t nat -A PREROUTING -i $EXTIF -p tcp --dport 3389 -j DNAT --to-destination $WINDOWSBOX

I am assuming that SNAT has already been enabled in the firewall with rules like:
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP

Comment: The above is potentially very insecure.

Personally, I use a SSH tunnel with X forwarding and key authorisation to connect to my Linux server, and then run rdesktop on the server.

Last edited by allend; 01-23-2011 at 06:52 AM.
 
Old 01-24-2011, 02:18 AM   #6
black hole sun
Member
 
Registered: Jul 2004
Distribution: Slackware Current
Posts: 127

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by allend View Post
I think the OP is simply needing to set up port forwarding to a Windows box behind a Linux server.
This requires two iptables rules:
1) A rule to accept incoming requests to port 3389 e.g.
$IPTABLES -A INPUT -i $EXTIF -p tcp -s $EXTNET1 --dport 3389 -j ACCEPT
and
2) A rule to forward the request to the target Windows box e.g.
$IPTABLES -t nat -A PREROUTING -i $EXTIF -p tcp --dport 3389 -j DNAT --to-destination $WINDOWSBOX

I am assuming that SNAT has already been enabled in the firewall with rules like:
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP

Comment: The above is potentially very insecure.

Personally, I use a SSH tunnel with X forwarding and key authorisation to connect to my Linux server, and then run rdesktop on the server.
Thank you, that's just what I needed. I'll try this on the morrow and hopefully it will work.
 
  


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
Connect to server in windows network from debian desktop mira.mikes Linux - Networking 3 12-03-2009 03:33 PM
How to connect to a Linux Terminal server from a Windows XP desktop computer gautamnarayan Linux - Networking 3 10-01-2009 04:53 PM
realvnc server installed on fed9 attempting to connect to server from windows desktop nataloi Linux - General 1 04-21-2009 09:31 AM
Is it possible to connect Windows XP with Linux server world.vijay Linux - Newbie 1 11-06-2008 01:58 AM
Connect to Linux desktop from a *PUBLIC* Windows computer (eg from a browser) 1veedo Linux - General 8 05-08-2007 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:01 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