Re: pgAdmin with SSHTunneling support

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: pgAdmin with SSHTunneling support
Date: 2012-10-23 11:33:33
Message-ID: CANxoLDfSC5NLgeFn0fcsxGUDfcgboRqJZwfEH2m09xN8pFrddQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Wed, Oct 17, 2012 at 7:42 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> Hi
>
>
> On Wed, Oct 17, 2012 at 1:44 PM, Akshay Joshi
> <akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
> > Hi Dave
> >
> > I have implemented SSH Tunneling and integrate it with pgAdmin3. I have
> > tested it on Windows, Linux and MAC. Attached is the patch file.
> > Please review it and if it looks OK then can you please commit it.
>
> Cool :-)
>
> I found a couple of things on my initial tests on Mac:
>
> - On my first attempt to connect to a server, I opened the properties
> dialogue, and enabled SSH Tunneling, specifying the username and host
> etc. When I then tried to connect to the server it prompted for the
> SSH password, but didn't prompt for a password for the database, so
> the connection failed. The second time I tried, it first prompted for
> the database password, then then SSH password which worked fine. When
> I restarted pgAdmin, it again failed to prompt for the database
> password on the first, but not second attempts.
>

Here the problem is we don't have an entry in the "pgpass" file for the
localip:port pair(one end of the SSH tunnel). At the first attempt to
connect
to server it looks for the pgpass entry If stored password is checked,
in this case user will find the error message. In the second attempt it
first
prompted for the database password which will be store in the variable
and in this case user will not bet any error and then for the subsequent
attempts it uses the password which is stored in the variable. If we
restart pgAdmin, again the same problem will occur.

>
> - If I attempt to connect via SSH Tunnel, but cancel when I'm prompted
> for a password, the connection attempt proceeds anyway, then fails
> first with a valid error message about password auth failing, then
> with an "empty" error message about connecting to the (database?)
> server.
>
> - When attempting to connect with an identity file, I first get
> prompted for a password anyway, then if I just hit return on that
> dialogue, I get a message telling me that identity file auth failed
> (followed by the same "empty" error message).
>

Fixed in the updated patch. Attached is the updated patch.

>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
*Akshay Joshi
Senior Software Engineer
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Phone: +91 20-3058-9522
Mobile: +91 976-788-8246*

Attachment Content-Type Size
SSHTunnel_pgAdmin_v1.patch application/octet-stream 1.6 MB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Tomas Barton 2012-10-24 11:20:26 Re: Czech UI translation
Previous Message Dave Page 2012-10-21 16:26:28 Re: Error while trying to any FTS Object with name containing spaces