Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

From: Jorge Arevalo <jorgearevalo(at)libregis(dot)org>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Date: 2014-08-08 17:49:46
Message-ID: CAMhtMNP0AVxzX1cc1Dzhok-b=P28HmQ6bGPriCx_fSEg8MkBrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 7, 2014 at 3:43 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 08/07/2014 01:39 AM, Jorge Arevalo wrote:
>
>
>> What OS are you on?
>>
>> Per:
>> http://www.postgresql.org/__docs/9.1/interactive/auth-__
>> methods.html#AUTH-PEER
>>
>> <http://www.postgresql.org/docs/9.1/interactive/auth-
>> methods.html#AUTH-PEER>
>>
>> "Peer authentication is only available on operating systems
>> providing the getpeereid() function, the SO_PEERCRED socket
>> parameter, or similar mechanisms. Currently that includes Linux,
>> most flavors of BSD including Mac OS X, and Solaris."
>>
>>
>>
>> Linux system (Ubuntu 12.04). Also tested in Mac OS 10.8.
>>
>> Forgot to mention: in pg_hba.conf there is a previous line:
>>
>> local postgres peer
>>
>
> That would be the issue, assuming you are doing something along lines of
> psql -d some_db -U postgres per:
>
> http://www.postgresql.org/docs/9.1/interactive/auth-pg-hba-conf.html
>
> " The first record with a matching connection type, client address,
> requested database, and user name is used to perform authentication. There
> is no "fall-through" or "backup": if one record is chosen and the
> authentication fails, subsequent records are not considered."
>
>
> If you are not connecting as above, you will need to show us your
> connection string.

Actually, it's connecting now. I've applied the map to the first entry in
pg_hba.conf

local all postgres peer map=vp.

So, I'm identifying vagrant with postgres, as desired, and it works.

Many thanks for your responses!

Best regards,

--
Jorge Arevalo

http://about.me/jorgeas80

>
>
>
>> No map specified for that line.
>>
>>
>>
>> --
>> Jorge Arevalo
>>
>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Deb Brooks 2014-08-08 20:30:22 Where can I download PostgreSQL 9.4 for AIX 6?
Previous Message Adrian Klaver 2014-08-08 13:45:16 Re: postgresql referencing and creating types as record