我正在尝试从 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)
有关的:
Sun Java System Directory Server Enterprise Edition 6.0 管理指南
ldapdelete是删除条目,需要使用ldapmodify删除属性。
这个命令应该删除attribute1,并attribute2从username条目:
$ 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)