Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A94E02E0032 for ; Sun, 16 Dec 2007 15:27:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 51967-04 for ; Sun, 16 Dec 2007 15:27:36 -0400 (AST) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.189]) by postgresql.org (Postfix) with ESMTP id 301442E005B for ; Sun, 16 Dec 2007 15:27:36 -0400 (AST) Received: by mu-out-0910.google.com with SMTP id i10so2867014mue.3 for ; Sun, 16 Dec 2007 11:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=gzHBNp5Je7GFGkk20w7pkFbQLbjLfFGLl7A8vUyKZDE=; b=FmwL9TAaJN7Bjm2mwybfIPB82HlQmMtTAF/5fPwQDwXyYmZt3Q3QlCwMl96fILTNyKyQX8nQ232e3PZoOqNSScnlVJwtPgi/HTN772AE7SvqkXMO/kdH6Xd0SqAgf6zMBKNEZDm791Og/Kpnwt4jc9AVTgmaxkQxVx7ts5QcL+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=pvqBTDYSkvuZtqhUhbEjn7CF00nbDWuhIniUDVz71zwLdATUcLa/IlRzKOkJSGhfpQjGXMap2gSi0+/YMXaTESgDmm6LK2/tgBbd6JHg5udtDvVRQ3vqFfelfpIMXOxrx7VPPkNQV7J2UinwcoCgd8ydF6xO5CwD4QyYTuMtogw= Received: by 10.78.176.20 with SMTP id y20mr7224450hue.36.1197833223018; Sun, 16 Dec 2007 11:27:03 -0800 (PST) Received: by 10.78.151.9 with HTTP; Sun, 16 Dec 2007 11:27:02 -0800 (PST) Message-ID: Date: Mon, 17 Dec 2007 00:27:02 +0500 From: "Usama Dar" To: "Klay Martens" Subject: Re: pg_hba.conf is driving me nuts Cc: pgsql-admin@postgresql.org In-Reply-To: <000701c83efa$8c570b40$0100000a@klaydual> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5596_2459395.1197833223012" References: <000701c83efa$8c570b40$0100000a@klaydual> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/124 X-Sequence-Number: 27641 ------=_Part_5596_2459395.1197833223012 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > 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 ------=_Part_5596_2459395.1197833223012 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline


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.net 5432, 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
------=_Part_5596_2459395.1197833223012--