我目前使用“md5”身份validation从lan访问:
host all all 192.168.1.0/24 md5
我想添加ldapauthentication方法,所以我在之前添加了这一行:
host all all 192.168.1.0/24 ldap "ldap://192.168.1.2/basedn;uid=;,cn=xx,dc=yy,dc=zz,dc=ca"
这项工作与ldap帐户很好,但如果我尝试用LDAP服务器上不存在的帐户login,login失败(postgresql不尝试md5身份validation)。
有一种方法来支持postgresql的多个身份validation方法?
否 – Since the pg_hba.conf records are examined sequentially for each connection attempt, the order of the records is significant. 换句话说,“第一场比赛是我将要使用的方法”。
在继续进行“所有用户”LDAPauthentication之前,您必须明确列出所有本地( md5 )帐户,才能使其工作(并且在维护pg_hba.conf文件时开始变得非常pg_hba.conf )。
作为一种解决方法,您可以使用pamauthentication方法,并将PAM的“postgres”服务configuration为使用您希望的任何方法(包括回退到备用方法),但这会限制您在系统上安装/configuration的任何PAM模块。
(有关“限制”的适当宽泛的定义 – 例如,如果您使用PAM作为身份validation方法,则可以使用Postgres帐户的一次性密码)。