Thread: PG-Admin 4 - SSH-Tunneling

PG-Admin 4 - SSH-Tunneling

From
Urs Brauchli
Date:
Hi List,<div class=""><br class="" /></div><div class="">I downloaded and installed PGAdmin 4 and now I'm trying to set
upan SSH-Tunnel via Terminal, since the option is no longer present in the connection-Window.</div><div class=""><br
class=""/></div><div class="">But - it fails. Whenever I try to connect, PGAdmin tells me: </div><div class=""><br
class=""/></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class=""
style="font-family:Roboto, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">Unable to connect to
server:</span></div><brclass="" style="box-sizing: border-box; font-family: Roboto, sans-serif; font-size: 14px;
font-variant-ligatures:normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates:
normal;font-variant-east-asian: normal; line-height: 20px; background-color: rgb(255, 255, 255);" /><span class=""
style="font-family:Roboto, sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space:pre"> </span>SSL error: unknown
protocol</span><brclass="" style="box-sizing: border-box; font-family: Roboto, sans-serif; font-size: 14px;
font-variant-ligatures:normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates:
normal;font-variant-east-asian: normal; line-height: 20px; background-color: rgb(255, 255, 255);" /><span class=""
style="font-family:Roboto, sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space:pre"> </span>expected
authenticationrequest from server, but received S</span><div class=""><span class="" style="font-family: Roboto,
sans-serif;font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric:
normal;font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px; background-color: rgb(255,
255,255);"><br class="" /></span></div><div class=""><span class="" style="font-family: Roboto, sans-serif; font-size:
14px;font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal;
font-variant-alternates:normal; font-variant-east-asian: normal; line-height: 20px; background-color: rgb(255, 255,
255);">AmI doing something wrong, or is PGA4 just unable to use the tunnel?</span></div><div class=""><span class=""
style="font-family:Roboto, sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);"><br class="" /></span></div><div class=""><span class="" style="font-family:
Roboto,sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);">Thanks for your help</span></div><div class=""><span class="" style="font-family:
Roboto,sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);"><br class="" /></span></div><div class=""><span class="" style="font-family:
Roboto,sans-serif; font-size: 14px; font-variant-ligatures: normal; font-variant-position: normal;
font-variant-numeric:normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 20px;
background-color:rgb(255, 255, 255);">Urs</span></div> 

Re: PG-Admin 4 - SSH-Tunneling

From
Dave Page
Date:
Hi

On Fri, Sep 30, 2016 at 11:04 AM, Urs Brauchli <urs.brauchli@update.ch> wrote:
> Hi List,
>
> I downloaded and installed PGAdmin 4 and now I'm trying to set up an
> SSH-Tunnel via Terminal, since the option is no longer present in the
> connection-Window.

Correct. We hope to implement it for v2.0.

> But - it fails. Whenever I try to connect, PGAdmin tells me:
>
> Unable to connect to server:
>
> SSL error: unknown protocol
> expected authentication request from server, but received S
>
> Am I doing something wrong, or is PGA4 just unable to use the tunnel?

I just tried it here and it works fine for me. I setup a tunnel as follows:

ssh -f dpage@hostname.enterprisedb.com -L 5999:
hostname.enterprisedb.com:5432 -N

Of course, you should be able to use a different host for the SSH
tunnel (the first hostname) than the target (the second hostname) if
appropriate in your environment. Then, I added a server to pgAdmin
with a host address of 127.0.0.1 and port 5999 and logged in as
normal.

I was running on Mac, but the same procedure should work on Linux. On
Windows, there's a tunnelling app in Putty iirc, but I don't know how
to use it offhand.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PG-Admin 4 - SSH-Tunneling

From
Dave Page
Date:
> Could this be a problem with the SSL CERT? (Or the version of SSL?)
> This link, while for curl instead of posstgres, may have a clue about what
> might be going on
>
> http://blog.techstacks.com/2010/03/3-common-causes-of-unknown-ssl-protocol-errors-with-curl.html

I suspect it's that the port numbers are getting mixed up, and Urs is
actually pointing pgAdmin at a port that (either directly, or through
the tunnel) has OpenSSH listening on it - the reason being that
OpenSSH responds to a connection with:

SSH-2.0-OpenSSH_5.3

Or similar, depending on the version.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: PG-Admin 4 - SSH-Tunneling

From
Darren Duncan
Date:
On 2016-09-30 4:05 AM, Dave Page wrote:
> On Fri, Sep 30, 2016 at 11:04 AM, Urs Brauchli <urs.brauchli@update.ch> wrote:
>> I downloaded and installed PGAdmin 4 and now I'm trying to set up an
>> SSH-Tunnel via Terminal, since the option is no longer present in the
>> connection-Window.
>
> Correct. We hope to implement it for v2.0.

So now that v1.0 is officially out, which is great news, do you have an estimate 
for about how long until this v2.0 would come out?  Might you be following 
Postgres' example by releasing a major version each year, and hence we should 
see the built-in SSH-Tunnel support by this time next year?  From an ease of use 
perspective, it would be great for users if the tunneling didn't take too 
terribly long to become available.  Thank you. -- Darren Duncan




Re: PG-Admin 4 - SSH-Tunneling

From
Dave Page
Date:
On Fri, Sep 30, 2016 at 6:53 PM, Darren Duncan <darren@darrenduncan.net> wrote:
> On 2016-09-30 4:05 AM, Dave Page wrote:
>>
>> On Fri, Sep 30, 2016 at 11:04 AM, Urs Brauchli <urs.brauchli@update.ch>
>> wrote:
>>>
>>> I downloaded and installed PGAdmin 4 and now I'm trying to set up an
>>> SSH-Tunnel via Terminal, since the option is no longer present in the
>>> connection-Window.
>>
>>
>> Correct. We hope to implement it for v2.0.
>
>
> So now that v1.0 is officially out, which is great news, do you have an
> estimate for about how long until this v2.0 would come out?  Might you be
> following Postgres' example by releasing a major version each year,

That's the plan.

> hence we should see the built-in SSH-Tunnel support by this time next year?
> From an ease of use perspective, it would be great for users if the
> tunneling didn't take too terribly long to become available.  Thank you. --

But we're more open to adding features in minor releases (which of
course, PostgreSQL never does). The requirements on pgAdmin are far
less strict than they are on PostgreSQL when it comes to adding new
features. IOW, I hope we'll be able to add SSH support sooner rather
than later.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company