RDP over SSH Tunnel


 
Thread Tools Search this Thread
Special Forums Cybersecurity RDP over SSH Tunnel
# 1  
Old 10-16-2012
RDP over SSH Tunnel

Hi all,
I'm trying have an alternative way of connecting into a Corporate network. Mostly in case the VPN down as I cannot also change the security policy.
I want to expose windows RDP over ssh tunnel.
I have 3 hosts in my scenario
1- Host a : Windows 2k8 has no internet access just only an outbound connection on Port 22 TCP .
2-Host b: AIX 5.3 has an ssh server running on it and can initiate outbound TCP connections to any host on the internet.
3-Host C : Solaris 10 has a public static IP and an SSH listening for incoming connections.
All I want is to expose RDP on Host A to Host C which is outside my corporate network How can I do this any Idea will be a great assist.
# 2  
Old 10-17-2012
You can do a tunnel on ssh as a port forwarder, where it listens somewhere for the RDP client tcp connection and forwards it to the target desktop port 3389 (or whatever port you reconfigure to. For instance you can ssh localhost on a firewall host and make tcp port 3389 listen there and forward connections to the windows box port 3389.

If the ssh encryption is not a concern, there is a program tcpRelay.c that can listen of be an inetd child and forward to any given port, even allowing configuration of specific host access permissions and different destinations, as a general firewall tcp proxy.
# 3  
Old 10-18-2012
@DGPickett Thanks for your reply more explanation required please
What I meant is to forward RDP on host A to host C through host B as a man in the middle.
Host A has no access to any other host except host B trough SSH connection via putty or plink or any ssh client and Host B has virtually ability to connect to any host outside my corporate network I want to forward RDP from host A though host B to be visible from host C.
I want the exact recipe in details if applicable Encryption is a big matter in my scenario .

Last edited by h@foorsa.biz; 10-18-2012 at 11:05 AM..
# 4  
Old 10-18-2012
Semantics cn cloud the issue. Every PC with RDP is a server, and the support dude has the client. The tcp client sends the first packet SYN, and if there is a listening socket, that replies with the second, reply packet SYN ACK. An ssh tunnel listens on one end of the ssh session host pair on some specified port, as a server, and forwards connections to the opposite end host to a new client socket connected to the host and port specified. So, ssh is the obvious tool, as long as one end is visible to each end. If you ssh localhost, the two middle hosts can be the same host.

Suppose on host A you "ssh -L 3389:C:3389 B", forwarding A:3389 to new client connections on B (high port) to port 3389 C, which is the target PC to be serviced port 3389. When your tech points his RDP client host D to A:3389, it will really be talking to the target PC RDP service. The RDP client D connects a socket on D:high-port to A:3389, A sends via ssh client app inside ssh connection to sshd server on B, which makes a new socket, connects it to C:3389, and everyone shuffles data flow both ways.

Security rules sometimes prevernt -L, but sometimes -R is legal, where the listening server part of the tunnel is on the sshd server end, and the new client sockets originate on the ssh client app.

Often, the problem is really simpler, and all that is not needed. A firewall E in the middle may able to see both C and D even though they cannot see each other, like if C is on the internet and D is on a 10. unroutable address. Using NAT or tcpRelay, it can listen for D and connect to C.

Now, if you want a dynamic service where many PCs can be the target, something like a web service could set up the forwarder or tunnel to the indicated host. For security, it is nice if there is a timeout and some filtering of incoming connections, so only D can temporarily get that connection to C:3389.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Tunnel using SSH

I am not clear with the part of concept of Tunneling using ssh. ssh -f -N -L 1029 192.168.1.47:25 james@192.168.1.47 I found out that above code works for me . but didn't quite well understood how ti works and need to ask you guys some questions. since we are using tunnel through ssh ... (2 Replies)
Discussion started by: lobsang
2 Replies

2. Solaris

Tunnel X over ssh for 11.3

Hello Solaris experts: Trying to bring the 11.3 gdm screen over ssh to a Linux Box: I did the following: 1. made chanes to /etc/ssh/sshd_config & bounced ssh daemon: # X11 tunneling options X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes 2. From the remote Linux box: ... (6 Replies)
Discussion started by: delphys
6 Replies

3. IP Networking

VPN ssh access over RDP port?

Guys, Can I use an open RDP port to gain ssh access to my Linux server running the other side of our firewall? I work from home on the odd occasion, we only have RDP port 3389 available once logged into the VPN. I would rather ssh into my workstation without the need for a desktop display. ... (3 Replies)
Discussion started by: general_lee
3 Replies

4. IP Networking

Help with SSH tunnel?

I have a Java web app on machine (X) that needs to talk to an LDAP server (Y) on :636, but the LDAP server is only accessible on a particular network. I can login to a machine (Z) on that network from X, and this machine can talk to the LDAP server on :636. How can I tunnel so that X can... (2 Replies)
Discussion started by: spacegoose
2 Replies

5. UNIX for Dummies Questions & Answers

SSH tunnel working for ssh but not for sshfs

I'm trying to setup a link between my home pc (work-machine) and a server at work (tar-machine) that is behind a gateway (hop-machine) and not directly accessible. my actions: work-machine$ ssh -L 1234:tar-machine:22 hop-machine work-machine$ ssh -p 1234 user@127.0.0.1 - shh access on... (1 Reply)
Discussion started by: Vathau
1 Replies

6. Programming

using a ssh tunnel with nx compression

hi everybody and thank you for this wondefrul forum this is my first thread posted here and i hope that i could find some help from your part (i am even sure) :D here is the situation: i am to develop an application of remote desktop access such as vnc, vpn and especially nx i want to develop... (0 Replies)
Discussion started by: bolboln01
0 Replies
Login or Register to Ask a Question