pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Usama Dar <munir.usama@gmail.com>
To: Klay Martens <kmartens@wol.co.za>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_hba.conf is driving me nuts
Date: Mon, 17 Dec 2007 00:27:02 +0500
Message-ID: <ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com> (raw)
In-Reply-To: <000701c83efa$8c570b40$0100000a@klaydual>
References: <000701c83efa$8c570b40$0100000a@klaydual>

> Now, I have set up all the appropriate port forwarding, made sure that
> there
> are no problems with firewalls on the server.


Just to make sure there really is no issue with firewall did you try
something like telnet on postgres host and port , like telnet
buggy.pg.net5432, you should get something like

telnet buggy.pg.net 5432
Trying buggy.pg.net...
Connected to buggy.pg.net.unknowndomain (some ip)
Escape character is '^]'.

i mean inorder for you to be able to directly connect to the postgres  over
WAN, you will need to open the postgres port  and you should be able to
remotely access it, just like you would open ports for ssh and ftp and other
utilities.


> I am fairly sure this is a result of a problem with pf_hba.conf.Can anyone
> advise how to configure pg_hba.conf to permit connections from any subnet
> and ip?


If there is no issue with firewall and the port is open the following should
do it

host    all         all         0.0.0.0/0             trust

if you want to avoid opening the port for security reasons use ssh
tunneling, or port forwarding something like following

ssh -L 2525:localhost:5432 user@remotehost

this will map the local 2525 port onto the remote hosts 5432 port, now you
can simply connect to the postgres like a local instance

psql -h localhost -p 2525 -U postgres




-- 
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

view thread (9+ messages)  latest in thread

Message-ID: <ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com>
Permalink:  ../ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com/
Also on:    postgresql.org/message-id/ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: munir.usama@gmail.com, kmartens@wol.co.za
  Subject: Re: pg_hba.conf is driving me nuts
  In-Reply-To: <ff0e67090712161127r6a940db2v4c31ea68cc5b31bd@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox