• Remote Desktop via Port forwarding through multiple servers

    I just had to give some assistance to a friend who needed to do a remote desktop session to a Windows work computer, but had to go through a couple of hops to get to it. I’ll give the setup below.

    He has a linux machine at home (HOME), and a linux machine at work (WORK). (WORK) has access to another Linux machine (WORK2) on the network that the Windows machine (WINDOWS) is on, but not to the Windows machine itself.

    In the code below you’ll substitute machine names (given above in parenthesis) with the actual IP or hostname of each machine. (Note: this should be all on one line)

    ssh -t -L HOME:3389:WORK:3389 user@WORK
    ssh -L WORK:3389:WINDOWS:3389 user@WORK2
    

    At that point he just had to remote desktop to HOME and he ended up with a session on WINDOWS.

    • Share/Bookmark

     Leave a reply