debugsqlMinor
Postgresql cannot peer authenticate using usermap (provided user name (^dbuser^) and authenticated user name (^sysuser^) do not match)
Viewed 0 times
postgresqlcannotusermatchpeerprovidedauthenticateusermapauthenticatedname
Problem
I am trying to peer authenticate some users using usermap. What I am trying to do is to map user mailreader as you can see:
Into system's user root,dovecot,postfix. Therefore I edited my
I also edited the
When I try to connect via
psql: FATAL: Peer authentication failed for user "mailreader"
error.
I also tried the following configuration:
Without any progress.
May I have some help?
Edit 1
The logs regarding the error is:
postgres=# \du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
mailreader | | {}
postgres | Superuser, Create role, Create DB, Replication | {}Into system's user root,dovecot,postfix. Therefore I edited my
pg_ident.conf and put the following content:mailmap dovecot mailreader
mailmap postfix mailreader
mailmap root mailreaderI also edited the
pg_hba.conf and appended with the following content:local mail all peer map=mailmapWhen I try to connect via
sudo psql -U mailreader -d mail command I get:psql: FATAL: Peer authentication failed for user "mailreader"
error.
I also tried the following configuration:
local mail all ident map=mailmapWithout any progress.
May I have some help?
Edit 1
The logs regarding the error is:
2017-06-27 19:10:10 UTC [1188-1] mailreader@mail LOG: provided user name (mailreader) and authenticated user name (root) do not match
2017-06-27 19:10:10 UTC [1188-2] mailreader@mail FATAL: Peer authentication failed for user "mailreader"
2017-06-27 19:10:10 UTC [1188-3] mailreader@mail DETAIL: Connection matched pg_hba.conf line 90: "local all all peer"Solution
In the end I had to comment the line:
Or to put it below the following line:
local all all peerOr to put it below the following line:
local mail all ident map=mailmapCode Snippets
local all all peerlocal mail all ident map=mailmapContext
StackExchange Database Administrators Q#177142, answer score: 5
Revisions (0)
No revisions yet.