If your Postgres instance is not accessible to the public, you can connect to it using an SSH tunnel
The SSH tunnel host must be on the same network as your Postgres host.
Enter the hostname, port, and username of the ssh tunnel you would like to use.
Copy the provided Public Key into the authorized_keys file in your SSH config for the username you provided.
authorized_keys
Note: the provided Public Key is generated during setup, and is unique to every connection.
This means that if you have multiple SSH tunnels, you will have multiple public keys in your authorized_keys
Last updated 2 years ago