PostgreSQL SSH Tunnel Connection (archive)

<?xml version="1.0" encoding="utf-8"?>
<html>

Postgres SSH Tunnel Connection

The following assumes the SSH sessions have been configured as discussed in FAQ: 3tera - Enable SSH Terminal Sessions into Server Appliances‎.

After creating a public and private key using the puttygen application, copy and paste the public key that appears in the window as below and e-mail the code to Will Goldberg

Will will create a user name for you using your first initial and last name.

Creating Your Putty Configuration File

Start a new session in Putty and use the following IP address for the Postgres server (as of December 1, 2009), type in the name for your session (in the example I typed in "MAD" and make sure you select SSH:

Next expand the SSH (click the plus sign) and Select the Auth option and using the following settings and setting the path to your private key file you generated.

Select the Tunnels option.  Under new forwarded port type in the source port as 5433 and the destination as db:5432 (db is for the database port as set on the server).

Click the ADD button and it should appear in the forwarded ports window as illustrated.

Select the Session option at top to return to the first screen and SAVE your configuration.

Opening Your Session in Putty

With Putty open, select the session you just created an enter your user name (first initial, last name) into login as then enter the password you used when you created your private key to log onto the server.  It's recommended that you also set the Window options as described in the article cited above.

Connecting to Postgres MAD with PGAdmin

Use the following setting to connect to the MAD using the port created in your tunnel session

</html>