OpenDSのサイトで公開されているOpenDS-x.y.z.zipをダウンロードし、インストールしておきたいディレクトリ(例えば/optに・・・)展開する。
# cd /opt
# unzip /download/OpenDS-1.0.0.zip
展開されたディレクトリにsetupスクリプトがあるので、実行する。GUIのインストールシールドがいらない場合は、-i (または --cli )オプションをつける。
# ./setup -i
OpenDS Directory Server 1.0.0
Please wait while the setup program initializes...
What would you like to use as the initial root user DN for the Directory
Server? [cn=Directory Manager]:
Please provide the password to use for the initial root user:
Please re-enter the password for confirmation:
On which port would you like the Directory Server to accept connections from
LDAP clients? [389]:
What do you wish to use as the base DN for the directory data?
[dc=example,dc=com]:
Options for populating the database:
1) Only create the base entry
2) Leave the database empty
3) Import data from an LDIF file
4) Load automatically-generated sample data
Enter choice [1]: 4
Please specify the number of user entries to generate: [2000]:
Do you want to enable SSL? (yes / no) [no]:
Do you want to enable Start TLS? (yes / no) [no]:
Do you want to start the server when the configuration is completed? (yes /
no) [yes]:
Setup Summary
=============
LDAP Listener Port: 389
LDAP Secure Access: disabled
Root User DN: cn=Directory Manager
Directory Data: Create New Base DN dc=example,dc=com.
Base DN Data: Import Automatically-Generated Data (2000 Entries)
Start Server when the configuration is completed
What would you like to do?
1) Setup the server with the parameters above
2) Provide the setup parameters again
3) Cancel the setup
Enter choice [1]:
Configuring Directory Server ..... Done.
Importing Automatically-Generated Data (2000 Entries) ........ Done.
Starting Directory Server .......... Done.
See /tmp/opends-setup-6158.log for a detailed log of this operation.
To see basic server configuration status and configuration you can launch /opt/OpenDS-1.0.0/bin/status
これで、OpenDSの初期セットアップが完了する。
GUIでインストールすると、ステータスパネルが表示されるが、CUIの場合は以下のコマンドで表示できる。
# bin/status-panel

操作として、起動、停止、再起動ができる。
コマンドで行う場合は、
bin/stop-ds
bin/start-ds
bin/status
等が使える。
検索を行うためのコマンドで一般的なldapsearchはOSに付属してくることもあるが、OpenDSのパッケージの中にも入っている。
dc=example,dc=com以下で、Aliceさんの情報を探す。
# bin/ldapsearch -b "dc=example,dc=com" givenName=alice
dn: uid=user.206,ou=People,dc=example,dc=com
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: top
postalAddress: Alice Alvarez$76758 Fifth Street$Montgomery, VT 20570
postalCode: 20570
uid: user.206
description: This is the description for Alice Alvarez.
employeeNumber: 206
initials: APA
givenName: Alice
pager: +1 640 631 8711
mobile: +1 409 702 6521
cn: Alice Alvarez
telephoneNumber: +1 683 988 9279
sn: Alvarez
street: 76758 Fifth Street
homePhone: +1 537 688 1363
mail: user.206@maildomain.net
l: Montgomery
st: VT
検索時に、ユーザー名(cn=Directory Manager, rootDN)を指定して検索する。
# bin/ldapsearch
-D "cn=Directory Manager" -b "dc=example,dc=com" givenName=alice
Password for user 'cn=Directory Manager':
dn: uid=user.206,ou=People,dc=example,dc=com
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: top
postalAddress: Alice Alvarez$76758 Fifth Street$Montgomery, VT 20570
postalCode: 20570
uid: user.206
description: This is the description for Alice Alvarez.
userPassword: {SSHA}pOU+Yu9o6KWLA8iUOMb3drPs2RAvHoaKkMUH2w==
employeeNumber: 206
initials: APA
givenName: Alice
pager: +1 640 631 8711
mobile: +1 409 702 6521
cn: Alice Alvarez
telephoneNumber: +1 683 988 9279
sn: Alvarez
street: 76758 Fifth Street
homePhone: +1 537 688 1363
mail:
user.206@maildomain.net
l: Montgomery
st: VT
Mozilla ThunderBirdのアドレス帳を使う。
[アドレス帳] -> [ファイル] -> [新規作成] -> [LDAPディレクトリ]
LDAPサーバーの登録

検索(住所がGoogle Mapと連動している)

ldap操作:
https://www.opends.org/wiki/page/HowToSearchInOpenDS#section-HowToSearchInOpenDS-WorkingWithUTF8AndSpecialCharactersInSearchFilters
LDIFを作成し、LDAPサーバーに登録する。
* ~/kdc.ldif
------------------------------
dn: uid=kdc.info,ou=People,dc=example,dc=com
changetype: add
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: top
postalAddress: 東京都 調布市 布田 4-6-1 調布丸善ビル 7F
postalCode: 183-0024
uid: info
givenName: infomation
cn: 有限会社ナレッジデザイン 受付
telephoneNumber: +81 042-440-7912
facsimileTelephoneNumber: +81 042-440-7913
sn: 有限会社ナレッジデザイン
mail:
info@knowd.co.jp
l: 東京都 調布市 布田 4-6-1 調布丸善ビル 7F
o: 有限会社ナレッジデザイン
---------------------------------
# bin/ldapmodify -a -D "cn=Directory Manager" -w password -f ~/kdc.dif
Processing ADD request for uid=kdc.info,ou=People,dc=example,dc=com
ADD operation successful for DN uid=kdc.info,ou=People,dc=example,dc=com
検索・・・
