Remote Desktop through multiple ssh tunnels (A - B - C)

2

1

I have 3 machines. Machine A which can access B, and B which can access C (which is a windows computer)

How can I connect with remote desktop directly from machine A to C with ssh tunnel

zz1433

Posted 2011-12-23T19:08:17.040

Reputation: 123

Answers

5

You will only need one tunnel, since there is only one machine in the middle.

  1. Connect from A to B using SSH, with a local tunnel from :<portX> to <machineC>:3389.

    Depending on your SSH client:

    • OpenSSH – ssh -fN -L<portX>:<machineC>:3389 <machineB>

    • PuTTY – source port <portX>, destination <machineC>:3389, type local.

      PuTTY also accepts the same -L option when run from command line.

  2. Connect from A to localhost:<portX> using Remote Desktop.

    • Windows Remote Desktop – enter localhost:<portX> in the Computer box.

      Or run mstsc /v localhost:<portX>.

Here <portX> is any port between 1024-65535, and not yet in use by machine A.

user1686

Posted 2011-12-23T19:08:17.040

Reputation: 283 655