首页 > 解决方案 > 使用 ldapmodify 命令更改 LDIF 文件中的密码

问题描述

我有一个测试用户的 LDIF 文件,我想更改密码。

我使用了 ldapmodify 命令:

ldapmodify -h localhost  -D uid=testuser,ou=users,dc=mytest,dc=org -w <password> <<!
dn: uid=testuser,ou=users,dc=mytest,dc=org
changetype: modify
replace: userPassword
userPassword: myNewPassword
!
modifying entry "uid=testuser,ou=users,dc=mytest,dc=org"

它看起来像工作

但是当我打开我的 file.ldif 时,密码没有改变并且 ldapsearch 命令不起作用。

ldapsearch -x -h localhost -D uid=testuser,ou=users,dc=mytest,dc=org -w myNewPassword -b uid=testuser,ou=users,dc=mytest,dc=org
ldap_bind: Invalid credentials (49)

感谢您的帮助

标签: ldap

解决方案


推荐阅读