Re: psql tunneling thru a middle server - Mailing list pgsql-general

From Rick Chu
Subject Re: psql tunneling thru a middle server
Date
Msg-id 1304624199.32354.41.camel@ricardochu.fcla.edu
Whole thread Raw
In response to psql tunneling thru a middle server  (jtkells@verizon.net)
List pgsql-general
On Thu, 2011-05-05 at 15:05 -0400, jtkells@verizon.net wrote:
> Im trying to connect my WS to a postgresql database (destination) via
> a middle server
> I.e.
> WS   ----> Middle ----> Database
>                 server          server
>               172.x.2.4       172.x.4.12
>
>
> I can create a SSH tunnel from my WS to the middle server but not sure
> how or if I can make the middle server pass connections to and from my
> ws and database.  BTW,  they run the DB on a non standard postrgres
> port.  Any help would be appreciated....
> Thanks
>

1. From your WS open two terminal(ssh) windows.

2. From Terminal#1 startup the ssh tunnel using:
ssh -L 5432:database.com:8432 you12@middle.com -p 20

3. From Terminal#2 connect to the database via the tunnel:
psql -p 5432 mydatabasename -U you12 -h localhost


RickC



pgsql-general by date:

Previous
From: Rick Genter
Date:
Subject: Re: Multiple table relationship constraints
Next
From: Bosco Rama
Date:
Subject: Re: Generating fields in views with search/replace?