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

From Frank Pinto
Subject Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Date
Msg-id CAATpuJpDtQ0-rhih1JFGq1bmbhunmNznuEfroMpSEWG97N=atQ@mail.gmail.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  (Ray Stell <stellr@vt.edu>)
List pgsql-general
Looks like you're doing it right, you actually have to specify the user though:

psql -U postgres

and make sure you restarted the server so your changes take effect.

Frank


On Wed, Aug 6, 2014 at 4:43 PM, Jorge Arevalo <jorgearevalo@libregis.org> 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)

Many thanks in advance (and sorry for the cross-posting. I asked this in serverfault too, but I think this is the right place)


--
Jorge Arevalo

http://about.me/jorgeas80

pgsql-general by date:

Previous
From: Jorge Arevalo
Date:
Subject: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Next
From: John R Pierce
Date:
Subject: Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method