This is my personal blog. I also have a professional blog at http://siliconsparrow.com/

13 June 2007

Tunneling rdesktop via SSH

Filed under: Nerd Notes — adam @ 5:08 pm

Tunnel.pngI have a Linux (Debian Etch) server which I am maintaining for a customer up in Queensland. A couple of Windows servers have been added to the network and I want to maintain them also.

I have an existing connection to the Linux server via SSH. There is a hole in the customer’s firewall to allow me to connect to it via SSH but not with any other protocol.

Here is how I can connect through my SSH connection to the Windows machine and remotely operate it on my local Linux PC.


1. On the Linux server, edit the file /etc/ssh/sshd_config and add the following line:

    PermitTunnel yes

Don’t forget to restart the SSH daemon on the server after this (I just rebooted it).

2. Install some basic X11 packages and rdesktop onto the Linux server:

apt-get install xbase-clients xterm rdesktop

3. On your local Linux machine, edit the file /etc/ssh/ssh_config and add the following line:

    Tunnel yes

You can now log in to the Linux server using the following command. Let’s say for example, the Linux server is tux.customer.net

ssh -X root@tux.customer.net

Finally bounce across to the Windows box like so. Let’s say the Windows box is called bill.customer.net

rdesktop -u Administrator bill.customer.net

You could even do it in one step like this:

ssh -X root@tux.customer.net "rdesktop -u Administrator bill.customer.net"

2 Comments »

  1. Comment by gustin — 16 May 2008 @ 2:15 pm

    why not just do:
    ssh user@host -L 3389:windows.machine.tld:3389

    Then rdesktop -u winuser localhost

    This does not require anything to be installed on the remote linux box.

    You can do multiple port forwards as well:

    ssh user@host -L 3389:windows.machine.tld:3389 -L 9389:another.windows.machine:3389

    rdesktop -u winuser2 localhost:9389

    Hth

  2. Pingback by Tunneling rdesktop via SSH « Mobile Tech Guy — 8 April 2009 @ 12:49 pm

    [...] 1 Comment ยป [...]

RSS feed for comments on this post.

Leave a comment

COMMENTS ARE DISABLED DUE TO EXCESSIVE SPAM. I'm sorry about this, I really love to read your comments but the amount of time I spend deleting spam is too much.


Powered by WordPress