Re: tunneling through ssh - Mailing list pgsql-admin

From jseymour@linxnet.com (Jim Seymour)
Subject Re: tunneling through ssh
Date
Msg-id 20040819022233.76F704313@jimsun.linxnet.com
Whole thread Raw
In response to tunneling through ssh  (David Bear <David.Bear@asu.edu>)
List pgsql-admin
David Bear <David.Bear@asu.edu> wrote:
>
> I'm attempting to run pgsql through a tunnel.
[snip]

Through an ssh tunnel, using port-forwarding, I'm guessing?

>
> Am I missing something obvious?

Can you "psql -p 5432" on the machine on which the server is running?

Here's what I just did successfully:

On local machine, ssh to host running pgsql server:

$ xterm -e ssh -L 57000:remote.example.com:5432 remote.example.com &

After doing the ssh pass-word/-phrase thing...

On local machine:

$ psql -U jseymour -p 57000 -h localhost
Password:
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

jseymour=> \q
$

Worked like a champ.  This is using OpenSSH, btw.

Jim

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: tunneling through ssh
Next
From: "Somasekhar Bangalore"
Date:
Subject: Urgent --- Installation error on UltraSPARC-IIi processor version Postgres 7.3.2