如何使用 ldap-utils 命令行删除 LDAP 中的特定属性?

ken*_*orb 3 ldap command-line

我正在尝试从 LDAP 用户中删除两个属性。

伪命令:

ldapdelete -D "uid=username,attribute1,attribute2" -w my_pass -h localhost
Run Code Online (Sandbox Code Playgroud)

我怎么做?


注意:搜索时我使用以下工作命令:

ldapsearch -D "cn=my-test,ou=Services,dc=foo,dc=com" -w my_pass -h localhost -b "ou=Non-Enterprise,ou=People,dc=foo,dc=com" -s sub -x -ZZ "(uid=username)"
Run Code Online (Sandbox Code Playgroud)

有关的:

如何使用 LDIF 删除 LDAP 中的一个属性?

Sun Java System Directory Server Enterprise Edition 6.0 管理指南

GitHub 上的示例

jll*_*gre 5

ldapdelete是删除条目,需要使用ldapmodify删除属性。

这个命令应该删除attribute1,并attribute2username条目:

$ ldapmodify -D "uid=..." -w ... -h ... <<%EOF%
dn: uid=username,ou=Non-Enterprise,ou=People,dc=foo,dc=com
changetype: modify
delete: attribute1
-
delete: attribute2
%EOF%
Run Code Online (Sandbox Code Playgroud)