Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Date
Msg-id 53E2B6F3.7020907@aklaver.com
Whole thread Raw
In response to Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method  (Jorge Arevalo <jorgearevalo@libregis.org>)
Responses Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method  (Jorge Arevalo <jorgearevalo@libregis.org>)
List pgsql-general
On 08/06/2014 03:43 PM, Jorge Arevalo wrote:
> Hello,
>
> I want to connect to my local installation of PostgreSQL 9.1 using my
> machine user (who is vagrant). So, after reading PostgreSQL
> documentation, I thought I just needed to:
>
> 1. Add username map in pg_ident.conf:
>
> # MAPNAME       SYSTEM-USERNAME         PG-USERNAME
>
> vp                       vagrant                                postgres
>
>
> 2. Using the map in pg_hba.conf
>
> # TYPE  DATABASE        USER            ADDRESS                 METHOD
>
> local       all                      all
>                    peer map=vp
>
> But I'm getting the error
>
> sql: FATAL:  Peer authentication failed for user "vagrant"
>
> If I try to connect to my server using psql.
>
> I guess I'm misunderstanding the PostgreSQL manual. But, how could I get
> what I need? (locally connect with the user vagrant like if it was the
> postgres user)
>

What OS are you on?

Per:
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."


>
> --
> Jorge Arevalo
>
> http://about.me/jorgeas80


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Next
From: Matthew Kelly
Date:
Subject: The dangers of streaming across versions of glibc: A cautionary tale