Skip to main content

openldap tools

ldapエントリの検索

ldapsearch -x [-H ldap:///] -D "<basedn>" -W -b <searchbase> [filter]

ldapmodifyによるエントリの更新

ldapmodify -x [-H ldap:///] -D "<basedn>" -W -f <file.ldif> [-n -v]
-n: dry-run
-v: verbose

ldapmodifyで使用するldifファイルの例

(例) 既存のdn に、新しい属性を追加する。
dn: uid=user1,ou=user,dc=example
changetype: modify
add: gecos
gecos: user1@example
<複数のエントリを続ける時は、空行で区切る>
dn: uid=user2,ou=user,dc=example
changetype: modify
add: gecos
gecos: user2@example