X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3115DD1C4BF; Thu, 7 Aug 2003 06:12:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 39934-06; Thu, 7 Aug 2003 03:11:21 -0300 (ADT) Received: from dns.robbyrussell.com (12-224-181-23.client.attbi.com [12.224.181.23]) by svr1.postgresql.org (Postfix) with ESMTP id F2BE6D1C488; Thu, 7 Aug 2003 03:12:33 -0300 (ADT) Received: from commandprompt.com (unknown [192.168.1.252]) by dns.robbyrussell.com (Postfix) with ESMTP id D1D2B94278; Wed, 6 Aug 2003 23:12:28 -0700 (PDT) Message-ID: <3F31C3A0.5010506@commandprompt.com> Date: Wed, 06 Aug 2003 23:12:32 -0400 From: Robby Russell Organization: Command Prompt, Inc User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030727 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Cath Lawrence Cc: pgsql-novice@postgresql.org, pgsql-php@postgresql.org Subject: Re: [PHP] authentication question References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/49 X-Sequence-Number: 7855 Cath Lawrence wrote: > Hi, > > Not sure if this is a novice or a PHP question; so I sent it to both. > > Anyway, I can't seem to deny access to my database through the web > server/PHP connection... > > In my pg_hba.conf, at the top, before getting to the real databases, > I have: > # temporary, cath testing access on example > local temp all reject > host temp all 127.0.0.1 255.255.255.255 reject > host temp all 0.0.0.0 255.255.255.255 reject > > Command line psql won't let me connect to temp - so far so good. > But when I use PHP's pg_connect with host, dbname, username, password > specified, it lets me through. It does fail non-users or bad passwords > - but all existing postgresql users seem to be able to make the > connection regardless. > > What have I missed? Ultimately, I am trying to set this up so only > specific known users can connect to my database from particular hosts. Cath, I'm not sure if this will help you or not, but try adding this to the bottom (seen this as a common practice) # reject all connections from all hosts not granted above host all 0.0.0.0 0.0.0.0 reject -Robby -- Robby Russell, Sr. Administrator / Lead Programmer Command Prompt, Inc. rrussell@commandprompt.com http://www.commandprompt.com (503) 222.2783