> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting databases using SSH

> SSH tunnels allow you to connect to a database in a private network or add another layer of network encryption.

In this configuration, Omni establishes an encrypted connection to an SSH server on your network, and then uses SSH's Local Forwarding feature to route traffic through the SSH connection to the database in your network.

<Danger>
  Modifying a connection with an established SSH tunnel may result in disruptions **if you don't contact Omni support beforehand**.

  Changes include modifying the connection's `host` or `port` as well as rebuilding the SSH server and thus changing the SSH host keys.
</Danger>

## Setup

<Steps>
  <Step title="Set up the SSH server in your network" titleSize="h3">
    Omni recommends using OpenSSH server to complete this step, as it's guaranteed to be compatible with the OpenSSH client Omni uses to establish a connection. Most Linux distributions come with OpenSSH installed or easily installable through a package manager.

    Your SSH server must:

    * Be in a network that accepts traffic on the SSH port from Omni's [outbound IP addresses](/administration/security/omni-ip-addresses)
    * Be able to route traffic to the network that the database resides in
    * Be configured so that the database's firewall accepts traffic from the SSH server
  </Step>

  <Step title="Contact Omni support" titleSize="h3">
    After you set up the SSH server, contact Omni support with the following information:

    * **For the SSH server** - The host, port, and user needed to connect
    * **For the database you want to connect to Omni** - The type of database, along with its host and port. The host should be a private IP address or a DNS entry that resolves to a private IP.
  </Step>

  <Step title="Authorize the public key" titleSize="h3">
    After Omni support receives the required information, we will generate an authentication keypair and send you the public key to authorize on your SSH server.
  </Step>

  <Step title="Confirm the connection" titleSize="h3">
    Once this is complete, Omni support will confirm the SSH connection can be established and add the new database connection to your Omni instance. The connection can then be used like any other database connection.
  </Step>
</Steps>
