Search Postgresql Archives

Re: psql tunneling thru a middle server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2011-05-05 at 15:05 -0400, jtkells@xxxxxxxxxxx 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@xxxxxxxxxx -p 20

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


RickC



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux