Connecting via an SSH tunnel
Connecting Polytomic to databases through SSH
Polytomic supports connecting to some databases via an SSH tunnel. Integrations that support SSH connections include:
- Azure SQL
 - MS SQL Server
 - MySQL
 - PostgreSQL
 - Redshift
 
If your database server requires an SSH connection, we recommend you generate a new SSH key pair for Polytomic. The steps below describe how to do this for Ubuntu environments.
- Create a user account for Polytomic.
 
ubuntu@ip-10-0-5-194:~$ sudo adduser polytomic --disabled-password
Adding user `polytomic' ...
Adding new group `polytomic' (1001) ...
Adding new user `polytomic' (1001) with group `polytomic' ...
Creating home directory `/home/polytomic' ...
Copying files from `/etc/skel' ...
Changing the user information for polytomic
Enter the new value, or press ENTER for the default
	Full Name []:
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n]
- Switch to the Polytomic user and generate an SSH key pair.
 
ubuntu@ip-10-0-5-194:~$ sudo su polytomic
polytomic@ip-10-0-5-194:/home/ubuntu$ cd ~
polytomic@ip-10-0-5-194:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/polytomic/.ssh/id_rsa):
Created directory '/home/polytomic/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/polytomic/.ssh/id_rsa
Your public key has been saved in /home/polytomic/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:ofESkNzrFipL3Dq39csjkHoFg3my2UDPuOEPVGO22IA polytomic@ip-10-0-5-194
The key's randomart image is:
+---[RSA 3072]----+
| . ..o           |
|E o B..          |
| . & oo..        |
|  X O o= .       |
| + @ *o.S        |
|  X * +.         |
| . B +.          |
|  = +..o.        |
|   +.. .+o       |
+----[SHA256]-----+
The file /home/polytomic/.ssh/id_rsa will now contain the SSH private key needed for Polytomic to connect.
- Authorize the public key for the 
polytomicuser. 
polytomic@ip-10-0-5-194:~$ cd ~/.ssh/
polytomic@ip-10-0-5-194:~/.ssh$ cp id_rsa.pub authorized_keys
- Create a new connection in Polytomic. Databases which support SSH connections will display the option 'Connection over SSH Tunnel?'. Tick the 'Connect over SSH Tunnel?' box to reveal SSH configuration fields.
 

- 
Fill in the SSH configuration fields. Paste the contents of your private key file (
/home/polytomic/.ssh/id_rsain our example above) into the 'Private key' text field. - 
Click 'Save'.
 
Updated 5 months ago