Skip site navigation (1) Skip section navigation (2)

Re: ssl tunneling in postgres 8.1

From: "P Kapat" <kap4lin(at)gmail(dot)com>
To: "Obe, Regina" <robe(dot)dnd(at)cityofboston(dot)gov>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ssl tunneling in postgres 8.1
Date: 2008-11-19 09:44:48
Message-ID: daef5be80811190144o1dbe727bha521795e5b030f9c@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
oh sweet sweet god.. finally!!!

On 11/19/08, Obe, Regina <robe(dot)dnd(at)cityofboston(dot)gov> wrote:
> PK,
>
> Sorry about that I should have elaborated on the optional in that article.
> I'll update that article with this if this works for you.
>
>  There is actually nothing magical about 5432.  Its just that if you have
> the ports the same on local and remote, you just need one forwarding rule.
> If you are forwarding to different ports -  then you need a rule to go one
> way and a rule to go the other way.
>
> Anyrate to fix your problem -  your tunneling should look something like
> this
>
> R5432  -- > localhost:5433
> L5433   --> localhost:5432

Thank you Regina. If I ever come to Boston, I owe you a drink :))

So, let us consider the the following "official" postgresql documentations:
http://www.postgresql.org/docs/8.1/static/ssh-tunnels.html (carried
over to: 8.2, 8.3 and also valid for the "interactive" versions in
place of "static")
The suggested commands are:

client$ ssh -L 3333:foo.com:5432 joe(at)foo(dot)com
client$ psql -h localhost -p 3333 postgres

They are just INCOMPLETE, half-baked mess :( In fact, they are simply
wrong! These pages state: "The name or IP address between the port
numbers is the host with the database server you are going to connect
to."  !!!!!!!

The correct commands are (at least the ones that worked in my case):

client$ ssh -R 5432:localhost:3333 -L 3333:localhost:5432 joe(at)foo(dot)com
client$ psql -h localhost -p 3333 postgres -U joe (or whatever the DB
username/Role is)

Right? If so, then the documentation needs to be updated (rather,
rectified), for heaven's sake!

Once again, thanks a ton, Regina :)
-- 
Regards
PK
--------------------------------------
http://counter.li.org  #402424

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2008-11-19 17:56:51
Subject: Re: ssl tunneling in postgres 8.1
Previous:From: Ognjen BlagojevicDate: 2008-11-19 09:42:19
Subject: Mailing list problem: TLD .rs not recognized as valid

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group