Re: Connect to PostgreSQL server from an ADSL connection

From: tony <tony(at)tgds(dot)net>
To: Szabolcs Andrási <andrasi(dot)szabolcs(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Connect to PostgreSQL server from an ADSL connection
Date: 2006-01-01 19:52:52
Message-ID: 1136145173.2833.51.camel@hush.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Le dimanche 01 janvier 2006 à 20:05 +0100, Szabolcs Andrási a écrit :
> > ssh -v -L 5432:localhost:5432 dbuser(at)your(dot)dyndns(dot)domaine
> >
> > Then connect to your database on localhost.

> Thank you very much for your answer. Sorry to bother you again with
> the same question but unfortunately it is still not clear to me how to
> configure the PostgreSQL server. Could you please be more specific and
> detailed? Let me write an exact situation to make the answer easier:

The postgresql server must also be running SSH server. You use the SSH
client to forward the postgresql port to your local computer. Your
client computer does not need to have a domain name.

> - PostgreSQL is newly installed, so now everything is set to default values.
> - The PostgreSQL server is runing on a computer with a domain name for
> example "my.pgserver.com" and listening on port 5432.

So for you the SSH comand line would be
ssh -v -L 5432:localhost:5432 dbuser(at)my(dot)pgserver(dot)com

> - A client application is running on this remote computer. This
> application would like to connect to the PostgreSQL server on
> "my.pgserver.com" and fetch some data from a table.

You open your client and point it to localhost:5432

SSH is forwarding the distant 5432 port to your local computer through a
secure tunnel. This is totally transparent for server and client - the
server needs no configuration. You can forward the postgres port to
another port number if you wish (for example you are running a
postgresql server on your local machine too).

Cheers

Tony
--
Tony Grant
www.tgds.net - vente d'ordinateurs mini-itx en ligne
www.tgds.net/epiaix1.html - A fedora Core 4 based live CD for VIA Epia-M

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message John DeSoi 2006-01-01 20:00:31 Re: Connect to PostgreSQL server from an ADSL connection
Previous Message Szabolcs Andrási 2006-01-01 19:05:22 Re: Connect to PostgreSQL server from an ADSL connection