From: | Dave Page <dpage(at)vale-housing(dot)co(dot)uk> |
---|---|
To: | "'fred(at)ontosys(dot)com'" <fred(at)ontosys(dot)com> |
Cc: | "'Peter E(dot) Chen'" <pchen3(at)jhmi(dot)edu>, pgadmin-support(at)postgresql(dot)org |
Subject: | Re: |
Date: | 2001-12-20 20:21:51 |
Message-ID: | FED2B709E3270E4B903EB0175A49BCB10473AA@dogbert.vale-housing.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
Thanks for that Fred, do you mind if I use it as the basis for a howto
(properly credited of course)?
Regards, Dave.
> -----Original Message-----
> From: fred(at)ontosys(dot)com [mailto:fred(at)ontosys(dot)com]
> Sent: 20 December 2001 17:54
> To: Dave Page
> Cc: 'Peter E. Chen'; pgadmin-support(at)postgresql(dot)org
> Subject: Re: [pgadmin-support]
>
>
> On Thu, Dec 20, 2001 at 04:22:41PM -0000, Dave Page wrote:
> > > Can you tell me exactly how to tunnel? I'm not sure I'm
> > > doing it correctly. How do I know if its working?
> >
> > Sorry Peter, I've never done it and don't have a clue how. Fred (if
> > you're reading this :-) ), do you have a couple of minutes to give
> > some pointers on this?
>
> Executive summary:
>
> + Set up a local machine (call it "mylocalhost") to forward, via
> SSH, local port 35432 to remote port 5432 on the Postgres server
> (call it "dbhost").
>
> + Connect via pgAdmin to port 35432 on mylocalhost.
>
>
> Details (specific to OpenSSH on mylocalhost):
>
> + Add the following to $HOME/.ssh/config in mylocalhost:
>
> Host dbhost
> Hostname dbhost.com
> User mynameondbhost
> LocalForward 35432 dbhost.com:5432
> GatewayPorts yes
>
> The 35432 port number is arbitrary. GatewayPorts must be allowed if
> you're running pgAdmin on a different machine than mylocalhost. In
> my case, mylocalhost is a Linux box on my LAN.
>
> + Open an ssh connection from mylocalhost to dbhost, and
> leave it open:
>
> $ ssh dbhost
>
> These first two steps can be combined by using command-line
> parameters to ssh to specify the port-forwarding, but I prefer to
> use the config file method.
>
> + Add the following to the pg_hba.conf file on dbhost:
>
> host all nnn.nnn.nnn.nnn 255.255.255.255 password
>
> where 'nnn.nnn.nnn.nnn' is the IP address of dbhost. I found that
> it didn't suffice to just have the standard similar entries for
> 'local ...' and 'host all 127.0.0.1 ...'.
>
> + Run pgAdmin and connect to mylocalhost:
>
> Server: mylocalhost
> Port: 35432
> Username: [as normal]
> Password: [as normal]
>
> + When done with pgAdmin you may wish to tear down the ssh connection.
>
> Note that the same forwarded port can be used with all the
> other Postgres utilities:
>
> $ psql -h mylocalhost -p 35432 -l -U postgres
> $ pg_dump -h mylocalhost -p 35432 -u some_db_name
> etc
>
> --
> Fred Yankowski fred(at)OntoSys(dot)com tel: +1.630.879.1312
> Principal Consultant www.OntoSys.com fax: +1.630.879.1370
> OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA
>
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Hauser | 2001-12-22 00:23:45 | pgAdmin under wine - how?? |
Previous Message | fred | 2001-12-20 17:53:44 | Re: |