設定
以下のような組織を追加するものとする
項目 | 設定値 |
---|---|
トップDN | dc=example,dc=co,dc=jp |
組織名 | people |
組織DN | ou=people,dc=example,dc=co,dc=jp |
また、LDAPに接続する情報は以下とする
項目 | 設定値 |
---|---|
管理者DN | cn=Manager,dc=example,dc=co,dc=jp |
パスワード | password |
トップオブジェクトを追加
ldifファイルの作成
※ /tmp/top.ldif として作成するものとする
dn: dc=example,dc=co,dc=jp
objectClass: dcObject
objectClass: organization
dc: example
o: example
追加
# ldapadd -x -D "cn=Manager,dc=example,dc=co,dc=jp" -W -f /tmp/top.ldif
Enter LDAP Password: (パスワードを入力)
adding new entry "dc=example,dc=co,dc=jp"
確認
# slapcat
# slapcat
570376d9 The first database does not allow slapcat; using the first available one (2)
dn: dc=example,dc=co,dc=jp
objectClass: dcObject
objectClass: organization
dc: example
o: example
structuralObjectClass: organization
entryUUID: e9e1a9d6-8f53-1035-8328-fbe69abdd39f
creatorsName: cn=Manager,dc=example,dc=co,dc=jp
createTimestamp: 20160405082700Z
entryCSN: 20160405082700.960264Z#000000#000#000000
modifiersName: cn=Manager,dc=example,dc=co,dc=jp
modifyTimestamp: 20160405082700Z
組織を追加
定義するldifファイルを作成
※ /tmp/people_org.ldif として作成するものとする
dn: ou=people,dc=example,dc=co,dc=jp
objectclass: organizationalUnit
ou: people
追加
# ldapadd -x -D "cn=Manager,dc=example,dc=co,dc=jp" -W -f /tmp/people_org.ldif
Enter LDAP Password:(パスワードを入力)
adding new entry "ou=people,dc=example,dc=co,dc=jp"
確認
# slapcat
57037816 The first database does not allow slapcat; using the first available one (2)
(略)
dn: ou=people,dc=example,dc=co,dc=jp
objectClass: organizationalUnit
ou: people
structuralObjectClass: organizationalUnit
entryUUID: 781244c2-8f54-1035-8329-fbe69abdd39f
creatorsName: cn=Manager,dc=example,dc=co,dc=jp
createTimestamp: 20160405083059Z
entryCSN: 20160405083059.515268Z#000000#000#000000
modifiersName: cn=Manager,dc=example,dc=co,dc=jp
modifyTimestamp: 20160405083059Z