Postgresql客户端身份验证问题

发布于 2024-11-08 03:45:49 字数 599 浏览 0 评论 0原文

我正在与 postgresql 的访问控制文件 pg_hba.conf 作斗争......它从来都不快乐,我想做的就是直接前进: A) 允许从本地主机访问全部 B) 允许从 10.8.0.* (VPN) 访问所有 C)拒绝所有剩余的

我已经阅读了 pgsql 官方网站上的 wiki 页面,但无法弄清楚我的配置有什么问题;我连接到 VPN(效果很好),然后尝试使用 pgadmin => 连接到 pgsql失败;我还尝试安装一个简单的 punBB 论坛(与数据库服务器在同一台机器上),但我得到无法连接到数据库...这都是配置问题...

这是我的示例当前权限:

host    all     all     10.8.0.0/24     md5
local   all         postgres                          ident
local   all         all                               ident
host    all         all         127.0.0.1/32          trust

有什么想法吗?

I am struggling with the postgresql's access control file pg_hba.conf... it's never happy, and all I want to do is straight forward:
A) Allow access to ALL from localhost
B) Allow access to ALL from 10.8.0.* (VPN)
C) Deny ALL remaining

I've read the wiki page on the pgsql's official website, but can't figure out what's wrong with my configuration; I connect to the VPN (which works nice) and then attempt to connect to pgsql using pgadmin => fails; I also try to install a simple punBB forum (on the same machine as the database server) and I get can't connect to database... It's all configuration issue...

Here's a sample of my current permissions:

host    all     all     10.8.0.0/24     md5
local   all         postgres                          ident
local   all         all                               ident
host    all         all         127.0.0.1/32          trust

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

踏月而来 2024-11-15 03:45:49

我不知道您读过哪个“pgsql 官方网站上的 wiki 页面”,但是 manual 非常好,并且有示例:

# Allow any user on the local system to connect to any database with
# any database user name using Unix-domain sockets (the default for local
# connections).
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
local   all             all                                     trust

# The same using local loopback TCP/IP connections.
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
host    all             all             127.0.0.1/32            trust

# Allow any user from 10.8.0.0/24 to connect to all
# databases if the user's password is correctly supplied.
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
host    all             all             10.8.0.0/24             md5

并且不要忘记在更改后重新加载服务器。

I have no idea which "wiki page on the pgsql's official website" have you read but the manual is quite nice and has examples:

# Allow any user on the local system to connect to any database with
# any database user name using Unix-domain sockets (the default for local
# connections).
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
local   all             all                                     trust

# The same using local loopback TCP/IP connections.
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
host    all             all             127.0.0.1/32            trust

# Allow any user from 10.8.0.0/24 to connect to all
# databases if the user's password is correctly supplied.
#
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
host    all             all             10.8.0.0/24             md5

And don't forget to reload the server after the changes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文