Drivers

SSH Tunnelling

SSH tunneling is a secure method to access databases that are not directly accessible from your Gigantic instance. This documentation explains how SSH tunnels work and how to configure them properly.

What is SSH Tunnelling?

SSH (Secure Shell) tunneling is a network technique that creates a secure encrypted connection between your Gigantic instance and a remote database server through an intermediate SSH server. It's essentially a "tunnel" that allows you to bypass network restrictions and securely access databases.

When to Use SSH Tunnelling

Use SSH tunneling when your target database:

  1. Is not directly accessible - The database server is behind a firewall or in a private network that doesn't allow direct connections from your Gigantic instance
  2. Only listens on localhost - The database server is configured to only accept connections from localhost (127.0.0.1) for security reasons
  3. Requires network encryption - You need to ensure all data transmitted between your Gigantic instance and the database is encrypted
  4. Is in a remote/private network - The database is hosted in a remote data center, cloud private network, or corporate network

How SSH Tunneling Works

When you enable SSH tunneling, the connection flow becomes:

  1. Gigantic connects to the SSH server (using SSH credentials)
  2. SSH server forwards the connection to the target database server
  3. Database operations are performed through this secure tunnel

This creates a secure encrypted channel for database communications, protecting sensitive data and credentials in transit.

SSH Tunnel Connection Diagram

Below is a diagram showing how SSH tunneling works to securely connect to a database:

GiganticInstanceSSHServerDatabaseServerDirect connection blocked1. SSH Connection2. Forwarded Connection3. Database Operations via Secure TunnelSSH Tunnel ConnectionBlocked Direct Connection

SSH Tunnel Configuration Parameters

The tunnel is set in the Advanced section of the tap or sink form. Check Enable SSH? to show its fields:

UI FieldDescriptionRequiredDefault Value
Enable SSH?Checkbox to connect to the database through an SSH tunnelNoUnchecked
Host/IPHostname or IP address of the SSH serverYesNone
PortPort of the SSH serverYesNone (usually 22)
UserUsername for the SSH authenticationYesNone
Auth methodHow to authenticate on the SSH server: Password or Private keyNoPassword

Authentication Options

The fields shown below Auth method depend on the option selected:

Auth methodUI FieldsDescription
PasswordPassword (required)Standard username/password SSH authentication
Private keySet key path + Private key path + PassphraseKey-based authentication with a key file on the Gigantics server. If the path is empty, the ~/.ssh/id_rsa key of the user running Gigantics is used
Private keyEnter key + Private key (required) + PassphraseKey-based authentication with the key pasted in the form

Passphrase is optional: fill it only when the private key is encrypted.

Best Practices

  1. Use key-based authentication when possible instead of passwords for better security
  2. Restrict SSH user permissions to only what's needed for database access
  3. Use non-standard SSH ports if security by obscurity is desired
  4. Regularly rotate SSH keys and update them in your Gigantic configuration
  5. Monitor SSH access logs to detect unauthorized access attempts

Troubleshooting SSH Tunnels

Common issues and solutions:

  1. Connection timeouts - Verify SSH server is reachable and port is correct
  2. Authentication failures - Check username, password/key, and passphrase
  3. Permission denied - Ensure SSH user has proper access to database server
  4. Key format issues - Ensure private key is in the correct format (usually PEM)

Each database driver that supports SSH tunneling will link to this documentation for detailed configuration information. The individual driver documentation pages focus on their specific database connection parameters, while this page covers the common SSH tunnel configuration that can be applied across drivers.