dbx/docs/content/docs/ssh-tunnel.mdx

53 lines
2.0 KiB
Plaintext

---
title: SSH Tunnel
description: Connect securely to databases behind firewalls via SSH tunnel. Password and key authentication.
---
<Callout type="info">
Built-in SSH tunnel — no manual terminal setup. Supports password and private key authentication, with optional LAN exposure for team sharing.
</Callout>
DBX can connect to databases through an SSH tunnel, allowing secure access to servers behind firewalls or on private networks.
## Configuration
When creating or editing a connection, enable the SSH tunnel option:
| Field | Description |
|---|---|
| SSH Host | Hostname or IP of the SSH server |
| SSH Port | Port for SSH (default: 22) |
| SSH User | Username for SSH authentication |
## Authentication Methods
<Tabs groupId="ssh-auth" items={['Private Key (Recommended)', 'Password']}>
<Tab value="Private Key (Recommended)">
Select a private key file (e.g., `~/.ssh/id_rsa`, `~/.ssh/id_ed25519`):
- **Key Path** — Use the file picker to browse and select your key file
- **Key Passphrase** — Enter the passphrase if your key is password-protected
Key authentication is more secure than password authentication.
</Tab>
<Tab value="Password">
Enter your SSH password directly. Works on servers that allow password authentication.
</Tab>
</Tabs>
## Expose Tunnel to LAN
<Callout type="warn">
Enabling LAN exposure means any device on the same network can access the tunneled database port. Only enable this on trusted networks.
</Callout>
By default, the SSH tunnel listens on `localhost` only. Enable LAN exposure to bind to `0.0.0.0`, making the tunnel accessible to other devices on your network — useful for team collaboration or multi-device access.
## How It Works
1. DBX establishes an SSH connection to the specified server
2. Creates a local port that forwards traffic through the tunnel to the database
3. Connects to the database through the forwarded local port
The tunnel remains active for the duration of the connection and closes automatically when you disconnect.