Difference between revisions of "Remote desktop using SSH tunneling"

Line 9: Line 9:
 
To overcome this problem you can use a SSH tunnel. That's how it look like:
 
To overcome this problem you can use a SSH tunnel. That's how it look like:
  
[[File:Tunnel SSH.png|500px]]
+
[[File:Tunnel SSH.png|950px]]
  
  
 +
==Requirements==
  
Due to the latency the result might be a little "slow", so let's consider that as a Plan B​.  
+
* You must be able to SSH to the middle server (''code.vehco.com'' in the example) from both ends [source + target].
 +
* The '''source''' computer is a Windows workstation.
 +
* The '''target''' computer can be anything: iPad, Windows, Linux, Android...  
  
  
Tunnel_SSH.png
 
  
 +
==Source PC==
  
 +
Requirements:
 +
* Windows computer with RDP enable
 +
* Bitvise # Tunnelier -> http://www.bitvise.com/download-area
  
Source PC (= French workstation)
+
 
Enable Windows RDP​
+
How to proceed ?
Install bitvise
+
 
Create a SSH tunnel
+
* Enable Windows RDP​
Allez dans l'onglet S2C  
+
* Install bitvise # Tunnelier
Add a new entry
+
* Create a SSH tunnel
LISTEN => remote server (code.vehco.com)
+
** Start Tunnelier
LISTEN interface: 127.0.0.1 ​
+
** Go to the '''S2C''' tab
LISTEN port: what_you_want (ex: 60001)
+
** '''Add''' a new entry
DESTINATION => local machine (RDP server)
+
*** LISTEN => remote server (''code.vehco.com'' in that example)
DESTINATION interface: localhost
+
**** LISTEN interface: 127.0.0.1 ​
DESTINATION port: 3389  
+
**** LISTEN port: what_you_want (ex: 60001)
​image001.png
+
*** DESTINATION => local machine (RDP server)
​Allez dans l'onglet LOGIN
+
**** DESTINATION interface: localhost
server: code.vehco.com
+
**** DESTINATION port: 3389  
port: TCP 22  
+
** Go to the '''login''' tab
login: vadmin
+
*** server: code.vehco.com
passwd: Julgran123
+
*** port: TCP 22  
 +
*** login: ''myLogin''
 +
*** passwd: ''myPassword''
  
 
​Save your profile !
 
​Save your profile !

Revision as of 15:23, 15 October 2014


Principle

Sometimes you cannot open the external Windows RDP port TCP 3389. It can be for a security reason or simply because you do not manage your company's firewall.


To overcome this problem you can use a SSH tunnel. That's how it look like:

Tunnel SSH.png


Requirements

  • You must be able to SSH to the middle server (code.vehco.com in the example) from both ends [source + target].
  • The source computer is a Windows workstation.
  • The target computer can be anything: iPad, Windows, Linux, Android...


Source PC

Requirements:


How to proceed ?

  • Enable Windows RDP​
  • Install bitvise # Tunnelier
  • Create a SSH tunnel
    • Start Tunnelier
    • Go to the S2C tab
    • Add a new entry
      • LISTEN => remote server (code.vehco.com in that example)
        • LISTEN interface: 127.0.0.1 ​
        • LISTEN port: what_you_want (ex: 60001)
      • DESTINATION => local machine (RDP server)
        • DESTINATION interface: localhost
        • DESTINATION port: 3389
    • Go to the login tab
      • server: code.vehco.com
      • port: TCP 22
      • login: myLogin
      • passwd: myPassword

​Save your profile ! Start it

To start bitvise automatically: ​Create a new entry in your Windows > Start menu > startup ​folder put the following shortcut: "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile="portforward.tlp" –loginOnStartup

where "portforward.tlp" = the name of your profile


That's All !! :-) [!] You have to log-in on your PC for the SSH tunnel to work. [!] You should disable screensavers | energy savers otherwise your PC will NOT be available anymore.


Target PC (= your Laptop) # Windows Install a RDP client Install bitvise ​Go to the tab: S2C Add a new entry LISTEN => remote server (code.vehco.com) LISTEN interface: 127.0.0.1 ​ LISTEN port: what_you_put_earlier (ex: 60001) DESTINATION => local machine (RDP server) DESTINATION interface: localhost DESTINATION port: 3390 ​image001.png ​Allez dans l'onglet LOGIN server: code.vehco.com port: TCP 22 login: vadmin passwd: Julgran123

​Save your profile ! Start it !

>>> Start Windows RDP client Connection to: localhost:3390


That's All !! :-) [!] Don't forget to adjust the port number 60001



Target PC (= your Laptop) # Linux

1. Create a SSH tunnel: ssh -v -N -L 127.0.0.1:3390:127.0.0.1:60001 vadmin@code.vehco.com

​local computer (= your laptop) remote computer (= the code.vehco.com server) This will open locally the port TCP 3390 and bind it to the remote port TCP 60001.


2. Then execute a RDP client and connect to localhost:3390


That's All !! :-)​ [!] Don't forget to adjust the port number 60001