Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Ubuntu, I'm trying to log into my friend's windows machine using rdesktop. First, I can log into his outward facing linux box using ssh. Then from there I can log into his linux host machine using ssh. This host machine is running Windows XP inside virtualbox. Is there a way for me to tunnel rdesktop through these two ssh connections (may just need the first connection to the outward facing linux box just to get inside the network, depending on how virtualbox's network connection is set up).

Thanks

share|improve this question

2 Answers 2

up vote 5 down vote accepted
ssh -L <some port>:<remote Windows host>:<rdesktop port> <some user>@<external Linux machine>

Then connect rdesktop to localhost:<some port>.

share|improve this answer

Here's the command that I use to enable inbound RDP-over-SSH on my Windows box using Cygwin:

ssh -R 3389:localhost:3389 -f -N kgregory@rivendell

OK, let's dissect this command. First off, it's a reverse tunnel: my Windows box has no inbound ports open, so I'm essentially opening a port by making an outbound connection.

The host I'm connecting to is rivendell, and I'm forwarding port 3389 (this is the first "3389" in the command). So there's an sshd running on rivendell that will be listening for connections to port 3389 on that host.

Then I'm forwarding those connections to port 3389 on localhost (my Windows box), which happens to be the port where rdesktop is listening.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.