Re: psql tunneling thru a middle server

From: Rick Chu <pygator(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql tunneling thru a middle server
Date: 2011-05-05 19:36:39
Message-ID: 1304624199.32354.41.camel@ricardochu.fcla.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2011-05-05 at 15:05 -0400, jtkells(at)verizon(dot)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(at)middle(dot)com -p 20

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

RickC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bosco Rama 2011-05-05 19:37:19 Re: Generating fields in views with search/replace?
Previous Message Rick Genter 2011-05-05 19:28:22 Re: Multiple table relationship constraints