允许LDAP用户更改密码

如何让LDAP用户从客户端机器更改密码?

你不能。 LDAP是目录服务,不提供最终用户工具。 最终用户工具负责提供此function。

例如应该可以使用'passwd',假设你已经使用configuration正确的LDAP进行了PAMauthentication

OpenLDAP的默认configuration已经有了:

# The userPassword by default can be changed # by the entry owning it if they are authenticated. # Others should not be able to see it, except the # admin entry below # These access lines apply to database #1 only access to attrs=userPassword,shadowLastChange by anonymous auth by self write by * none 

对于使用绑定帐户的389用户,可以按照以下绑定帐户创build一个ACL:

(targetattr =“*”)(version 3.0; acl“Bind Accounts”; allow(all)(groupdn =“ldap:/// cn =绑定账户,dc = ldap,dc = server”);

您可以启用ldap-auth-client(debian和ubuntu)来编辑密码,就像在本地机器上一样。 如果您运行dpkg-reconfigure ldap-auth-config并为Make local root Database adminselectyes,这将允许您像通常那样运行passwd

你也可以通过编辑你的/etc/ldap.conf文件并添加:

 # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/ldap.secret (mode 600) rootbinddn dn-for-your-admin-account-in-ldap 

如果您手动编辑文件,则需要在/etc/ldap.secret中发布root帐户的密码,并将其设置为600

您可能还必须编辑/etc/pam.d/common-password并删除use_authtok参数。 如果您编辑您的pam文件,请确保运行pam-auth-update或重新启动系统。