Re: Connecting via ssh tunnel

From: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: "Weerts, Jan" <j(dot)weerts(at)i-views(dot)de>, "ben short" <ben(at)benshort(dot)co(dot)uk>
Subject: Re: Connecting via ssh tunnel
Date: 2006-11-28 03:07:27
Message-ID: 200611271907.27298.uwe@oss4u.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 27 November 2006 02:38, Weerts, Jan wrote:
> Hi all!
>
> pgsql-general-owner(at)postgresql(dot)org wrote:
> > On Friday 24 November 2006 12:56, ben short wrote:
> >> I have a postgresql server setup on a Solaris 10 box. I can
> >> connect to the db via psql from the local machine. What I have
> >> been trying to do it connect with pgAdmin from my workstation. I
> >> have setup the tunnel correctly, local port 5432 and destination
> >> localhost:5432. Everytime I try to connect I get the following
> >> message.
> >
> > I guess the tunnel isn't correct. You connect on the same ports -
> > seems wrong to me. I'm using a tunnel like this:
> >
> > ssh -l <user> -L 5555:localhost:5432 <servername>
>
> actually
> ssh -l USER -L 5432:localhost:5432 SOMEOTHERHOSTTHANLOCALHOST
>
> is ok. the "localhost" part is evaluated on the SOMEOTHERHOST
> and dns lookup is done there. I have been bitten by this before.
> If SOMEOTHERHOST is the same host, this would obviously not
> work, since the ssh tunnel and the postgres server cannot
> listen on the same port.

Thinking about it I agree that this would work, unless you have postgresql
running on localhost (which is the case in my installation)

Uwe

--
Open Source Solutions 4U, LLC 1618 Kelly St
Phone: +1 707 568 3056 Santa Rosa, CA 95401
Cell: +1 650 302 2405 United States
Fax: +1 707 568 6416

In response to

Browse pgsql-general by date

  From Date Subject
Next Message wombat 2006-11-28 03:10:53 are wombats good?
Previous Message Ron Johnson 2006-11-28 02:23:52 Re: How to increace nightly backup speed