使用ldapmodify命令修改LDIF文件中的密码 [英] Modify passwords in an LDIF file using ldapmodify command
本文介绍了使用ldapmodify命令修改LDIF文件中的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个由一组测试用户组成的LDIF文件,我想更改这些用户的密码.
I have a LDIF file that consists of a set of test users and I would like to change the passwords for these users.
我使用了ldapmodify
命令:
ldapmodify -c -a -f filename.ldif -h localhost -p <port> -D dn -w <pwd> << !
dn: uid=<userid>,dc=<branch>,DC=COM
changetype: modify
replace: userPassword
userPassword: <new pwd>
!
然后出现以下错误:
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)
- 这是什么意思?
- 我使用的语法只能用于一个用户,我想修改LDIF文件中所有测试用户的密码.有办法吗?
推荐答案
给定的错误表明无法联系由主机名和端口指定的服务器,即无法建立连接.另外,当未指定-x
命令行选项时,旧版OpenLDAP ldapmodify
客户端默认为SASL绑定.
The given error is an indication that the server specified by the hostname and port could not be contacted, that is, a connection could not be established. Also, the legacy OpenLDAP ldapmodify
client defaults to a SASL bind when the -x
command line option is not specified.
LDIF输入可以包含任意数量的要修改的条目,而不仅仅是一个:
The LDIF input can contain any number of entries to be modified, not just one:
dn: uid=abc,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword: the-new-password
dn: uid=def,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword: another-new-password
另请参见
查看全文