Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .