7

I have a windows PC that is on network A and a windows PC on network B. Also in network B I have several Linux servers. From the PC on network A, I can ssh to any server on network B. I cannot, however, connect to the PC on network A from a computer on network B.

                                                      Windows PC Local
                                                       __  _          
                              can ssh                 [__]|=|         
              .-,(  ),-.    --------->    .-,(  ),-.  /::/|_|         
           .-(          )-.            .-(          )-. 
          (    Network A   )          (    Network B   )
           '-(          ).-'           '-(          ).-'
               '-.( ).-'    <---------     '-.( ).-'    
                            can't ssh               Linux Server #1
     Windows PC Remote                               __  _         
      __  _                                         [_Linux Server #2
     [__]|=|                                        /: __  _         
     /::/|_|                                          [__]|=|        
                                                      /::/|_|        

I would like to be able to RDP to my network A PC from my network B PC. Is this possible using some sort of reverse tunneling through one of the linux boxes?

  • 1
    Thanks to the person who created the awesome diagram for my question. – Triton Man Aug 27 '13 at 2:38
6

Solution 1: From your PC on network A, create a reverse ssh tunnel with something like Putty by connecting to a Linux host on Network B. The local port should be 3389, the remote host 127.0.0.1 and the port is arbitrary (lets use 6000 as an example). Then from your PC on network B, use putty to connect to the same Linux host, and do a forward tunnel. Local port should be set to something OTHER than 3389 (as microsoft RDP client will not allow connections to localhost, but it will allow connections to localhost on an arbitrary port). So lets reuse the same port number of 6000, the remote ip should be 127.0.0.1 and remote port 6000. You then point the RDP client at 127.0.0.1:6000 .

In effect you connect to port 6000 on PC in network B. Putty forwards that to the Linux host, which has been set to forward it to 127.0.0.1 on port 6000. The putty connection from the PC on network A listens on 6000 and forwards it to 127.0.0.1 on PC A to port 3389 which RDP then accepts the connection.

Solution 2: Setup an SSHD on the PC on network B, and then you only have to do a single reverse port forward. There is Bitvise SSHD which runs on Windows and is free for non-business use. Bitvise also do a separate client that handles RDP tunneling in conjunction with a WinSSHD. The nice thing about this solution it that is saves usernames, settings (like full screen and so forth), and can be launched from a save file and will stop you from having to set up/remember to connect the port forwards before using RDP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.