Connecting to a Private Network with an SSH Tunnel

SSH tunnel is one of the options available to connect to your database inside a private network.

Architectural Overview

You can choose to have the SSH tunnel host to be the same as your database machine:

DB & Tunnel Together

or on separate machine:

DB & Tunnel Separate

Configuring SSH Tunnel Server

  1. Whitelist Knowi's IP addresses into your SSH port (by default TCP port 22).

  2. Create a new cloud9 user account on tunnel machine:

    sudo useradd cloud9

  3. Switch user to cloud9:

    sudo su - cloud9

  4. Setup SSH permission for cloud9 user:

    mkdir ~/.ssh

    chmod 700 ~/.ssh

    cd ~/.ssh

    touch authorized_keys

    chmod 600 authorized_keys

  5. Download the public key and append its content into your authorized_keys file created above. You can also use ssh-copy-id command line tool (or similar tool) to install the our public key on to your tunnel machine.

Connecting to Your Datasource Through SSH Tunnel

After you have done all the steps above, now you are ready to connect to your datasource through the newly configured SSH tunnel through Knowi Datasource UI.

  1. Login to your Knowi account.

  2. Go to Datasources management page.

  3. Create new or edit existing datasource.

  4. Check the SSH Tunnel checkbox and enter your SSH tunnel server information using the following format:

    cloud9@<SSH Tunnel Host>[:<SSH Tunnel Port>]

Note: Your datasource host and port should now be set to what SSH tunnel server uses to connect.