With apologies to all for ranging further afield: for more fun:

    ssh -g -L 5000:localhost:5432 remotehost

(John's line with an added '-g' switch) will allow remote access to the
the port, as well.  That is, the public comes in on whichever machine the
ssh command is run.

You could run this on the same machine as the SQL server, though at that
point you don't need the encryption and there are probably better ways to
forward and masquerade a local port using IPTABLES or some such.

p.s.- don't forget to spring forward this morning! (for those who observe
daylight savings time).

http://kw.pm.org/ - Kitchener-Waterloo Perlmongers -          [EMAIL PROTECTED]
http://coder.com/ - Prescient Code Solutions - (519) 575-3733 [EMAIL PROTECTED]

On Sat, 5 Apr 2003, John Abreau wrote:

> I had a similar issue a couple years ago, where I wanted remote access
> to a Postgresql database so I could write a custom GUI to maintain it
> instead of having to ssh in and do everything from an xterm. I finally
> settled on using an ssh tunnel, which the remote server sees as coming
> from localhost, so I didn't have to mess with pg_hba.conf.
>
>     ssh -L 5000:localhost:5432 remotehost
>
> listens on port 5000 on the local machine, and passes anything it receives
> over to the ssh daemon on "remotehost", which then passes it to port 5432,
> which is the port that postgresql uses.
>
> This isn't particularly suited to giving public access to your database,
> if that's what you're after. But for granting access to users who are
> already trusted with shell accounts on the server, it works fine.
>
>
> - --
> John Abreau / Executive Director, Boston Linux & Unix
> Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
> PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to