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.

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
add comment

1 Answer

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
add comment

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.