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

UI FieldTechnical ImplementationDescriptionRequiredDefault Value
Enable SSH?Controls separate ssh2 client usageCheckbox to enable/disable SSH connectionYes (if using tunnel)false
SSH HostSSH connection hostRemote SSH server hostnameYesNone
SSH PortSSH connection portSSH server port numberNo22
SSH UsernameSSH userUsername for SSH authenticationYesNone
SSH PasswordSSH passwordPassword for SSH authenticationNo (if using key)None
SSH Private KeySSH keyPath to SSH private key for key-based authNo (if using password)None
SSH PassphraseSSH key passphrasePassphrase for encrypted private keysNoNone

Authentication Options

SSH tunneling supports multiple authentication methods:

Auth TypeUI MappingDescription
PasswordSSH Username/SSH Password fieldsStandard username/password SSH authentication
Key-basedSSH Private Key fieldSSH key-based authentication (more secure)
Key with PassphraseSSH Private Key + SSH Passphrase fieldsSSH key-based authentication with encrypted keys

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.