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

From: Jorge Arevalo <jorgearevalo(at)libregis(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Date: 2014-08-06 22:43:56
Message-ID: CAMhtMNObmvnP=LePgk23S2-1R=TvAkCoE__tNkKKGXq2iURpcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Pinto 2014-08-06 22:56:25 Re: Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method
Previous Message Martijn van Oosterhout 2014-08-06 21:38:37 Re: Recursive CTE trees + Sorting by votes