Thread: How to use SSH tunnels with pgAdmin?

How to use SSH tunnels with pgAdmin?

From
"Ken Winter"
Date:
<div class="Section1"><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">I’m suffering from a lot of dropped connections between pgAdmin and my PG databases, even after
verybrief inactivity.</span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt; 
font-family:Verdana"> </span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">Your documentation at <a
href="http://www.pgadmin.org/support/faq.php#ConnDrop">http://www.pgadmin.org/support/faq.php#ConnDrop</a>
says:</span></font><pclass="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt; 
font-family:Verdana"> </span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">…you could use a SSH tunnel for PostgreSQL traffic. SSH can be configured to keep the channel open
atall times, so that database traffic can be passed even after a prolonged period of inactivity. For information how to
configurethis, ask your SSH package's documentation for "tunneling".</span></font><p class="MsoNormal"><font
face="Verdana"size="2"><span style="font-size:10.0pt; 
font-family:Verdana"> </span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">My problem is, I don’t know how to set up pgAdmin to use my SSH package (PuTTY).  At least I think
that’smy problem.  Can you help?</span></font><p class="MsoNormal"><font face="Verdana" size="2"><span
style="font-size:10.0pt;
font-family:Verdana"> </span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">~ TIA</span></font><p class="MsoNormal"><font face="Verdana" size="2"><span
style="font-size:10.0pt;
font-family:Verdana">~ Ken</span></font></div>

Re: How to use SSH tunnels with pgAdmin?

From
"Ken Winter"
Date:
> -----Original Message-----
> From: Josh Berkus [mailto:josh@agliodbs.com]
> Sent: Saturday, February 27, 2010 3:46 PM
> To: Ken Winter
> Cc: pgAdmin Support List
> Subject: Re: [pgadmin-support] How to use SSH tunnels with pgAdmin?
>
>
> > My problem is, I don't know how to set up pgAdmin to use my SSH package
> > (PuTTY).  At least I think that's my problem.  Can you help?
>
> If regular port 5432 connections to your server are being dropped
> frequently, then I'm not sure an SSH tunneled connection is going to
> help you.  Any network flakiness would affect it equally.

The pgAdmin doc on this says:

'As the officially required solution, ask your network administrator to
vastly increase or even better disable TCP/IP connection watchdog timeouts
on the PostgreSQL port (usually 5432) to restore RFC compliant protocol
behaviour of the firewall.'

My host (WebFaction.com) says there is not a way to do this, so I went on to
the next part of the pgAdmin paragraph:

'If there's absolutely no way to accomplish this, you could use a SSH tunnel
for PostgreSQL traffic. SSH can be configured to keep the channel open at
all times, so that database traffic can be passed even after a prolonged
period of inactivity. For information how to configure this, ask your SSH
package's documentation for "tunneling".'
>
> Unless the connections are being dropped for some other reason?

Like what?  (Not a rhetorical question; I know basically nothing about these
connectivity issues.)

The connections aren't being dropped when I work with my other PG tool, PG
Lightning Admin, which does use SSH tunnels.

~ Ken



Re: How to use SSH tunnels with pgAdmin?

From
Dave Page
Date:
On Sun, Feb 28, 2010 at 2:39 AM, Ken Winter <ken@sunward.org> wrote:

> The connections aren't being dropped when I work with my other PG tool, PG
> Lightning Admin, which does use SSH tunnels.

The first hit I see on Google for 'pgadmin ssh tunnel' is this:
http://www.postgresonline.com/journal/index.php?/archives/38-PuTTY-for-SSH-Tunneling-to-PostgreSQL-Server.html

Seems like it might be useful :-)

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
PG East Conference: http://www.enterprisedb.com/community/nav-pg-east-2010.do


Re: How to use SSH tunnels with pgAdmin?

From
Guillaume Lelarge
Date:
Le 27/02/2010 21:18, Ken Winter a écrit :
> I'm suffering from a lot of dropped connections between pgAdmin and my PG
> databases, even after very brief inactivity.
> 
>  
> 
> Your documentation at http://www.pgadmin.org/support/faq.php#ConnDrop says:
> 
>  
> 
> .you could use a SSH tunnel for PostgreSQL traffic. SSH can be configured to
> keep the channel open at all times, so that database traffic can be passed
> even after a prolonged period of inactivity. For information how to
> configure this, ask your SSH package's documentation for "tunneling".
> 
>  
> 
> My problem is, I don't know how to set up pgAdmin to use my SSH package
> (PuTTY).  At least I think that's my problem.  Can you help?
> 

BTW, we intend to work on make it easier to add SSH tunnel from
pgAdmin's UI. See http://code.pgadmin.org/trac/ticket/49. Probably not
for next release, unless you (or someone else) can work on it.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: How to use SSH tunnels with pgAdmin?

From
Dave Page
Date:
On Sun, Feb 28, 2010 at 6:12 PM, Ken Winter <ken@sunward.org> wrote:
> Thanks, Dave.
>
> Following this lead, I tried to set up a SSH tunnel session using:
>
> a. PuTTY,
>
> b. my host's (WebFaction.com) instructions at
> http://docs.webfaction.com/user-guide/databases.html#accessing-a-database-re
> motely, and
>
> c. the pgAdmin instructions at
> http://www.postgresonline.com/journal/index.php?/archives/38-PuTTY-for-SSH-T
> unneling-to-PostgreSQL-Server.html.
>
> The setup and the results are shown in the screen shots in the attached
> doc1.doc:
>
> 1. The PuTTY setup, following the WF instructions.
> 2. The result when I try to connect via PuTTY, using the database name and
> password.
> 3. The setup in pgAdmin, following the pgAdmin instructions.
> 4. The verbose error message I get from pgAdmin, which would probably be
> helpful if I understood any of it.
>
> I'm hoping you can help me connect whatever dots I'm missing.

Probably not because I've never tried it myself, except on unix systems.

BTW, you'll find that most people here, myself included, won't open an
unsolicited Word document. I would suggest posting your screenshots as
PNG graphics files.

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
PG East Conference: http://www.enterprisedb.com/community/nav-pg-east-2010.do


Re: How to use SSH tunnels with pgAdmin?

From
Josh Berkus
Date:
> The connections aren't being dropped when I work with my other PG tool, PG
> Lightning Admin, which does use SSH tunnels.  

In that case:

http://oldsite.precedence.co.uk/nc/putty.html

--Josh Berkus



Re: How to use SSH tunnels with pgAdmin?

From
Josh Berkus
Date:
> My problem is, I don’t know how to set up pgAdmin to use my SSH package
> (PuTTY).  At least I think that’s my problem.  Can you help?

If regular port 5432 connections to your server are being dropped
frequently, then I'm not sure an SSH tunneled connection is going to
help you.  Any network flakiness would affect it equally.

Unless the connections are being dropped for some other reason?

--Josh Berkus



Re: How to use SSH tunnels with pgAdmin?

From
"Ken Winter"
Date:
I've been using a tunneled connection (with a keep-alive signal every 15
sec) for a couple of weeks now, and it's solid as a rock.  

It's inconvenient to have to manually bring up PuTTY and log in every time
before using pgAdmin, but I hear that you have an automatic connection
feature on your to-do list; that would be very welcome.

~ Thanks to all for your help
~ Ken

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-
> owner@postgresql.org] On Behalf Of Josh Berkus
> Sent: Saturday, February 27, 2010 3:46 PM
> To: Ken Winter
> Cc: pgAdmin Support List
> Subject: Re: [pgadmin-support] How to use SSH tunnels with pgAdmin?
> 
> 
> > My problem is, I don't know how to set up pgAdmin to use my SSH package
> > (PuTTY).  At least I think that's my problem.  Can you help?
> 
> If regular port 5432 connections to your server are being dropped
> frequently, then I'm not sure an SSH tunneled connection is going to
> help you.  Any network flakiness would affect it equally.
> 
> Unless the connections are being dropped for some other reason?
> 
> --Josh Berkus
> 
> 
> --
> Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-support



Re: How to use SSH tunnels with pgAdmin?

From
"Ken Winter"
Date:
Thanks, Wolfgang.  I'll give that a try when I get a chance.

> -----Original Message-----
> From: Wolfgang Pasche [mailto:pasche.wolfgang@kabelmail.de]
> Sent: Thursday, March 11, 2010 2:41 PM
> To: Ken Winter
> Cc: 'Josh Berkus'; 'pgAdmin Support List'
> Subject: Re: [pgadmin-support] How to use SSH tunnels with pgAdmin?
>
> Hi Ken,
>
> a possibly not too bad workaround could be to config a Putty session with
> automatic login, no shell,
> minimized window (such as 2 lines, 20 chars), using a key instead of
> password for authentication
> (config window SSH/auth). Then create a shortcut which calls Putty with a
> session parameter.
> In this case, you only have to double click the shortcut icon and wait
> some seconds before using
> PgAdmin. The complete session start incl. login is done automatically.
>
> Regards
> Wolfgang Pasche
> Hamburg, Germany
>
>
> Ken Winter schrieb:
> > I've been using a tunneled connection (with a keep-alive signal every 15
> > sec) for a couple of weeks now, and it's solid as a rock.
> >
> > It's inconvenient to have to manually bring up PuTTY and log in every
> time
> > before using pgAdmin, but I hear that you have an automatic connection
> > feature on your to-do list; that would be very welcome.
> >
> > ~ Thanks to all for your help
> > ~ Ken
> >
> >> -----Original Message-----
> >> From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-
> >> owner@postgresql.org] On Behalf Of Josh Berkus
> >> Sent: Saturday, February 27, 2010 3:46 PM
> >> To: Ken Winter
> >> Cc: pgAdmin Support List
> >> Subject: Re: [pgadmin-support] How to use SSH tunnels with pgAdmin?
> >>
> >>
> >>> My problem is, I don't know how to set up pgAdmin to use my SSH
> package
> >>> (PuTTY).  At least I think that's my problem.  Can you help?
> >> If regular port 5432 connections to your server are being dropped
> >> frequently, then I'm not sure an SSH tunneled connection is going to
> >> help you.  Any network flakiness would affect it equally.
> >>
> >> Unless the connections are being dropped for some other reason?
> >>
> >> --Josh Berkus
> >>
> >>
> >> --
> >> Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
> >> To make changes to your subscription:
> >> http://www.postgresql.org/mailpref/pgadmin-support
> >
> >




Re: How to use SSH tunnels with pgAdmin?

From
Wolfgang Pasche
Date:
Hi Ken,

a possibly not too bad workaround could be to config a Putty session with automatic login, no shell,
minimized window (such as 2 lines, 20 chars), using a key instead of password for authentication
(config window SSH/auth). Then create a shortcut which calls Putty with a session parameter.
In this case, you only have to double click the shortcut icon and wait some seconds before using
PgAdmin. The complete session start incl. login is done automatically.

Regards
Wolfgang Pasche
Hamburg, Germany


Ken Winter schrieb:
> I've been using a tunneled connection (with a keep-alive signal every 15
> sec) for a couple of weeks now, and it's solid as a rock.  
> 
> It's inconvenient to have to manually bring up PuTTY and log in every time
> before using pgAdmin, but I hear that you have an automatic connection
> feature on your to-do list; that would be very welcome.
> 
> ~ Thanks to all for your help
> ~ Ken
> 
>> -----Original Message-----
>> From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-
>> owner@postgresql.org] On Behalf Of Josh Berkus
>> Sent: Saturday, February 27, 2010 3:46 PM
>> To: Ken Winter
>> Cc: pgAdmin Support List
>> Subject: Re: [pgadmin-support] How to use SSH tunnels with pgAdmin?
>>
>>
>>> My problem is, I don't know how to set up pgAdmin to use my SSH package
>>> (PuTTY).  At least I think that's my problem.  Can you help?
>> If regular port 5432 connections to your server are being dropped
>> frequently, then I'm not sure an SSH tunneled connection is going to
>> help you.  Any network flakiness would affect it equally.
>>
>> Unless the connections are being dropped for some other reason?
>>
>> --Josh Berkus
>>
>>
>> --
>> Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-support
> 
>