Re: consulting the question about the usage about SSH Tunnel function

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "minsheng(dot)bai" <minsheng(dot)bai(at)wellintech(dot)com>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: consulting the question about the usage about SSH Tunnel function
Date: 2014-01-24 16:48:00
Message-ID: 52E29940.5010200@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 01/23/2014 06:06 PM, minsheng.bai wrote:
> dear all
> i have realized the SSH Tunnel function in the PostgreSQL.i did some
> work as follow:
> at the server side:
> 1.setup and configure the openssh
> 2.start opensshd
> 3.setup and deploy PostgreSQL
> at the client side:
> 1.setup openssh
> 2.execute command:ssh -L5555:localhost:5432
> Administrator(at)XXX(dot)XXX(dot)XXX(dot)XXX(the
> <mailto:Administrator(at)XXX(dot)XXX(dot)XXX(dot)XXX%28the> server IP)
> 3.use psql or pgAdmin to connect the server.
> i succeed.
> but i have a question:
> if i do not execute command:ssh -L5555:localhost:5432
> Administrator(at)XXX(dot)XXX(dot)XXX(dot)XXX <mailto:Administrator(at)XXX(dot)XXX(dot)XXX(dot)XXX>
> but i config the SSH Tunnel tab in the pgAdmin,as follow:
> whether i can connect the server or not .the result i try is failed.
> anyone can help me? thanks a lot.

I should have explained more in my previous post. In your command line
you have:

ssh -L5555:localhost:5432

I am assuming you then use 5555 as the port number in your connection
string from psql or pgAdmin and the connection succeeds.

When you set up the tunnel from pgAdmin I am not seeing a setting for
the listening port. So the solution is to either find some way to
specify the port from the pgAdmin dialog or find the port that pgAdmin
is setting on its own. My previous suggestion was an attempt at forcing
the port to one you have been using. Not sure if that will work. In the
event it does not you could see if you can find what port is actually
being used and adjust your connection strings accordingly.
> ------------------------------------------------------------------------
> minsheng.bai

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Emi Lu 2014-01-24 17:04:11 Re: find all views depend on a schema/table
Previous Message Adrian Klaver 2014-01-24 16:29:09 Re: consulting the question about the usage about SSH Tunnel function