Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnXI5-0000tM-ID for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 19:05:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnX6s-0005gm-VU for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Apr 2015 18:53:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YnWeC-0006uG-G1 for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 18:23:48 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YnWe8-0008RY-Du for pgsql-bugs@postgresql.org; Wed, 29 Apr 2015 18:23:47 +0000 Received: by pabtp1 with SMTP id tp1so34957378pab.2 for ; Wed, 29 Apr 2015 11:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=ad0sHkBos8m4npqOfvZnFJcsMcTYx2lXABIBi6+/cTk=; b=ZWc0p3jcLa7lluxnSy81poKB32YE9VIBBPyAB/RUlEvIlDHe6hvXk1VcGO0DzCDzbo Z1aPSn5LiqbPm0fWtQyr4XxVdWah3tipqx5dn03XS4gHYGzoj7xCzMM8S7mhcnrBg/1b g+sclU/KL27OGIsyGShrYOIzrjDDAmbWjMRPkNuKkr4232WRc9Vkbr56+mzrZBmEB8rl gxcHY/q12U6TlIBanyjzrbPl+zt7gJZCEg3lANuliS7cnE7vktj2dfjr6PbGigFfL+K6 ZEZ12NdvwErBfgcflVoLl5hE7eZxkKUdEvid9dNqt4XowwxwI1aTj7kOrl57xuhijCL0 emlA== X-Received: by 10.68.131.196 with SMTP id oo4mr535953pbb.119.1430331822071; Wed, 29 Apr 2015 11:23:42 -0700 (PDT) Received: from [192.168.1.12] (198-48-196-219.cpe.pppoe.ca. [198.48.196.219]) by mx.google.com with ESMTPSA id uf7sm4642799pab.37.2015.04.29.11.23.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 11:23:41 -0700 (PDT) Message-ID: <554121A9.3050207@gmail.com> Date: Wed, 29 Apr 2015 14:23:37 -0400 From: "bzb.dev001@gmail.com" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "David G. Johnston" CC: "pgsql-bugs@postgresql.org" Subject: Re: BUG #13188: .pgpass does not work References: <20150428181007.2546.64960@wrigleys.postgresql.org> <5540F428.8000605@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------060302030309010802000103" X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------060302030309010802000103 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 2015-04-29 12:04 PM, David G. Johnston wrote: > > On Wed, Apr 29, 2015 at 8:09 AM, bzb.dev001@gmail.com > > wrote: > I have even changed the ownership of the file to postgres:postgres > since I'm logged on as another user and .pgpass is located in this > user's home directory. Yet it still does not work. > > > $ ls -l .pgpass > -rw------- 1 postgres postgres 79 Apr 29 10:24 .pgpass > > > ​Sorry, I missed this the first time reading. This is your problem. > The "postgres" Linux user and the "postgres" PostgreSQL user are not > related to each other - particularly when using md5 authentication. > The permissions on the .pgpass file must be of the user executing > "psql" - which you've indicated is not "postgres". > > So, likely your first attempt failed because you had whitespace. You > changed the permissions and now have two problems. You then fix the > whitespace and are back to a single problem. Change the permissions > back and it should now work. > > David J. > > ​ I've changed back the owner of .pgpass to the account that I've logged in as. This is the account that I'm using to run psql. All the spaces in .pgpass is removed. Checked that the permission settings of .pgpass is ok. restarted the server... $ sudo service postgresql restart Unfortunately, it is still not working. $ psql --host=localhost --port=5432 --username=postgres --no-password psql: fe_sendauth: no password supplied Incidentally, the postgresql server is running as 'postgres' user. --------------060302030309010802000103 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 2015-04-29 12:04 PM, David G. Johnston wrote:

On Wed, Apr 29, 2015 at 8:09 AM, bzb.dev001@gmail.com <bzb.dev001@gmail.com> wrote:
 I have even changed the ownership of the file to postgres:postgres since I'm logged on as another user and .pgpass is located in this user's home directory. Yet it still does not work.

$ ls -l .pgpass
-rw------- 1 postgres postgres 79 Apr 29 10:24 .pgpass

​Sorry, I missed this the first time reading.  This is your problem.  The "postgres" Linux user and the "postgres" PostgreSQL user are not related to each other - particularly when using md5 authentication.  The permissions on the .pgpass file must be of the user executing "psql" - which you've indicated is not "postgres".

So, likely your first attempt failed because you had whitespace.  You changed the permissions and now have two problems.  You then fix the whitespace and are back to a single problem.  Change the permissions back and it should now work.

David J.

​

I've changed back the owner of .pgpass to the account that I've logged in as.  This is the account that I'm using to run psql.
All the spaces in .pgpass is removed.
Checked that the permission settings of .pgpass is ok.
restarted the server...

$ sudo service postgresql restart

Unfortunately, it is still not working.

$ psql  --host=localhost --port=5432 --username=postgres --no-password
psql: fe_sendauth: no password supplied

Incidentally, the postgresql server is running as 'postgres' user.

--------------060302030309010802000103--