在我的服务器上,我试图使用PostgreSQL9.5安装上的usermap对一些用户进行对等身份验证。我想要做的是映射用户邮件阅读器,如您所见:
postgres=# \du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
mailreader | | {}
postgres | Superuser, Create role, Create DB, Replication | {}进入系统的用户根,dovecot,后缀。因此,我编辑了我的pg_ident.cong并放置了以下内容:
mailmap dovecot mailreader
mailmap postfix mailreader
mailmap root mailreader此外,我还编辑了pg_hba.conf并附加了以下内容:
local mail all peer map=mailmap当我试图通过sudo psql -U mailreader -d mail命令连接时,我得到:
psql:致命:用户"mailreader“的对等身份验证失败
错误。
我还尝试了以下配置:
local mail all ident map=mailmap没有任何进展。
我能帮忙吗?
生成的有关错误的日志如下:
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 发布于 2017-06-27 19:14:54
最后,我不得不评论这句话:
local all all peer或者把它放在下面这一行:
local mail all ident map=mailmap关于/etc/postgresql/9.4/main/pg_hba.conf文件
发布于 2017-06-24 07:10:36
local mail app peer map=mailmap看上去不对,您想要的是all或mailreader而不是app。否则,您的配置看起来是正确的。您还可能需要在更改pg_hba.conf后重新加载postgres。
https://serverfault.com/questions/857642
复制相似问题