Knowledge base

Set up a reverse SSH tunnel from Windows

SSH (secure shell) tunneling is the process of forwarding selected ports through an authenticated and encrypted tunnel. In many cases, SSH tunneling is used to connect to a remote database that is secured behind a restrictive firewall or other network restrictions.This article walks you through the process of creating an SSH tunnel on Windows using PuTTy.

  1. Add a public key in your user settings. The public key will be propogated to all Xplenty servers in up to 30 minutes.

  2. Create a Tunnel Connection in Xplenty. Name your connection. Select Tunnel Connection from the Access Type dropdown menu. Enter the Database name, User name, and Password. Click Create connection. It will fail because we haven't created the tunnel yet, but the light blue box will appear and you will be able to retrieve Xplenty’s tunnel server (Xplenty server endpoint that includes everything before the colon) and connection port(the number after the colon).

  1. Download PuTTy.

  2. Start a new PuTTy session and set the Hostname to Xplenty server with port 50683. For example:

  1. Connection->Data, enter the tunnel username: sshtunnel

  2. Connection->SSH, check “Don’t start a shell or command at all”

  3. Connection->SSH->Auth, browse for your PPK private key that matches the public key you added in Xplenty.

  4. Connection->SSH->Auth->TTY, check “Don’t allocate a pseudo terminal”.

  5. Connection->SSH->Tunnel: Specify the source port (the connection port assigned to your connection, 53359 in this example), Specify the destination database’s host and port in the destination as “hostname:port”, select the “Remote” option and click “Add”.

  6. Save the connection - Go back to Session section in sidebar, enter a description for your stored session (xplenty here) then click the save button.

  7. Connect - double click the Xplenty session to initiate the connection.

  8. Return to the Xplenty dashboard. After entering the database name, username, and password, click Test Connection.

  9. Once the connection is successful, click Create Connection.