如何为多个IP地址配置postgresql postgresql.conf listen

编程入门 行业动态 更新时间:2024-10-27 17:19:36
本文介绍了如何为多个IP地址配置postgresql postgresql.conf listen_addresses的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以很好地连接到远程Postgresql服务器,该服务器对 pg_hba.conf 中的几个IP有连接限制,但是如果您有 listen_addresses 就足够了设置为 * 吗?

I can connect just fine to a remote postgresql server that has connection restrictions to a few IPs in the pg_hba.conf, but is this enough if you have listen_addresses set to "*" in the postgresql.conf file?

该文件表明该参数可以使用逗号分隔的IP地址列表,但是如果这样做,我将失去远程连接的能力。

That files indicates that that parameter can take a comma separated list of ip addresses, but if i do that, I lose the ability to connect remotely.

postgresql-8.4.9 rhel

postgresql-8.4.9 rhel

推荐答案

listen_addresses 控制哪个IP地址。服务器将应答,而不是服务器允许连接进行身份验证的IP。使用 listen_addresses'*'是完全合理和正常的,因此服务器将在使用pg_hba.conf 可以在更细粒度的级别上控制服务器将接受的IP地址登录特定数据库和用户。

listen_addresses controls which IPs the server will answer on, not which IPs the server will permit connections to authenticate from. It's entirely reasonable and normal to use listen_addresses '*' so the server will accept incoming connections on any ip assigned to an interface on the postgresql server host, while using pg_hba.conf to control access at a finer grained level for which IPs the server will accept logins from for specific databases and users.

更多推荐

如何为多个IP地址配置postgresql postgresql.conf listen

本文发布于:2023-10-15 11:53:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1494260.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   何为   地址   conf   listen

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!