本記事では、Solaris 10 をインストールした PC上で Directory Serverを構築する手順を紹介します。 # Solaris Night Seminar 5thに向けて。
最終目標は、同じSolaris PC上に Zoneを構築し、こちらをLDAPクライントとして、LDAPクライアント側でのログイン認証を、構築したDirectory Serverから実行することです。LDAPクライアント側の設定方法は、こちらです。
用意するもの
- Solaris 10をインストールしたマシン
- Directory Server Enterprise Edition (DSEE)
環境
- OS: Solaris 10 8/07 x86
- Directory Server Enterprise Edition 6.2
ネットワーク構成図
ダウンロード
Directory Server Enterprise Edition 6.2 (DSEE6.2)
http://www.sun.com/software/products/directory_srvr_ee/get.jsp
上記サイトより、[Download Now]をクリック、Sun オンラインアカウントでログイン後、
下記の項目を選択します。
- Select Component
- Directory Server Enterprise Edition 6.x
- Select Version:6.2
- Select Delivery Type:Native Package
- Select Platform:Solaris 10 X86
選択後、java_es-5u1-identsuite-ga-solaris-x86.zip をダウンロードします。
とりあえず、今回は/var/tmp/ディレクトリ以下に置きました。
インストール事前準備
通常であれば、Directory Server用にDNSの設定を行う必要がありますが、
今回はDNSサーバを構築しないで、Directory Serverをインストールしてみます。
1. /etc/defaultdomain ファイルの作成
ファイルの中身は、下記です。
example.com
2. /etc/hosts の編集
ファイルの中身は、下記です。
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.10.10 funa funa.example.com loghostzipファイルを展開します。
funa は、今回構築するサーバのホスト名です。
以上で、事前準備完了です。
DSEE6.2 インストール
# unzip /var/tmp/java_es-5u1-identsuite-ga-solaris-x86.zip
インストーラを実行します。
# cd /var/tmp/java_es-5u1-identsuite/Solaris_x86/
# ./installer
下記のようなウィンドウが立ち上がってきます。
①最初のウィンドウ
[次へ]を選択します。
②ソフトウェアライセンス使用許諾契約
同意頂ける場合は、[はい、ライセンス契約に同意します]を選択します。
③ソフトウェアコンポーネントの選択
Directory Server Enterprise Edition 6.2 を選択します。
-> するとDirectory Prepartion Tool 6.4 も必須で自動選択されます。
④アップグレードの必要がある共有コンポーネント
[次へ]を選択します。
⑤インストールディレクトリの指定
[次へ]を選択します。
⑥システム要件の確認
[次へ]を選択します。
⑦設定タイプの選択
設定タイプの選択で、[今すぐ設定]を選択します。
⑧共通サーバー設定の指定
DNSドメイン名やIPに間違いがなければ、管理者用のパスワードを入力して、[次へ]を選択します。⑨Directory Serverインスタンス作成
⑩Directory Server: インスタンス作成情報の指定
こちらで/var/opt/SUNWdsee/dsins1/にDirectory インスタンスを作成します。
そのまま[次へ]を選択します。⑪インストール準備完了
[インストール]を選択して、インストールが開始されます。
⑫インストール中
⑬インストールが完了しました
[閉じる]を選択して、インストール完了です。確認のため[サマリーの表示]を選択して、正しく
インストールされているか確認します。
以上で、インストールは完了です。
Directory Server インスタンス起動
dsadmコマンドで、作成したインスタンスを起動します。
# /opt/SUNWdsee/ds6/bin/dsadm start /var/opt/SUNWdsee/dsins1/
サーバーが起動しました: pid=18554
Directory Server インスタンス停止
dsadmコマンドでDirectory Serverインスタンスの動作を停止します。
# /opt/SUNWdsee/ds6/bin/dsadm stop /var/opt/SUNWdsee/dsins1/
サーバーが停止しましたLDIF ファイルのインポート
必ずしもインポートする必要はありませんが、ldapsearchでの検索の動作確認のため、
サンプルのLDIFファイルをインポートします。
# /opt/SUNWdsee/ds6/bin/dsadm import -i /var/opt/SUNWdsee/dsins1/ /opt/SUNWdsee/ds6/ldif/Example.ldif
dc=example,dc=com
データをインポート中...
[27/Feb/2008:17:11:07 +0900] - DEBUG - conn=-1 op=-1 msgId=-1 - Backend Instance: example
[27/Feb/2008:17:11:08 +0900] - Waiting for 6 database threads to stop
[27/Feb/2008:17:11:09 +0900] - All database threads now stopped
[27/Feb/2008:17:11:09 +0900] - import example: Index buffering enabled with bucket size 40
[27/Feb/2008:17:11:09 +0900] - import example: Beginning import job...
[27/Feb/2008:17:11:09 +0900] - import example: Processing file "/opt/SUNWdsee/ds6/ldif/Example.ldif"
[27/Feb/2008:17:11:09 +0900] - import example: Finished scanning file
"/opt/SUNWdsee/ds6/ldif/Example.ldif" (160 entries)
[27/Feb/2008:17:11:09 +0900] - import example: Workers finished; cleaning up...
[27/Feb/2008:17:11:12 +0900] - import example: Workers cleaned up.
[27/Feb/2008:17:11:12 +0900] - import example: Cleaning up producer thread...
[27/Feb/2008:17:11:12 +0900] - import example: Indexing complete.
[27/Feb/2008:17:11:12 +0900] - import example: Starting numsubordinates attribute generation. This
may take a while, please wait for further activity reports.
[27/Feb/2008:17:11:12 +0900] - import example: Numsubordinates attribute generation complete.
Flushing caches...
[27/Feb/2008:17:11:12 +0900] - import example: Closing files...
[27/Feb/2008:17:11:13 +0900] - import example: Import complete. Processed 160 entries in 4 seconds.
(40.00 entries/sec)
#
SMF へ登録
作成したDirectory Serverインスタンスの起動・停止等をSMFで管理出来るように、SMFへ登録します。
# /opt/SUNWdsee/ds6/bin/dsadm enable-service --type SMF /var/opt/SUNWdsee/dsins1/
「ディレクトリサーバー」を「application/sun/ds」として SMF に登録しています...
「/var/opt/SUNWdsee/dsins1」を「ds--var-opt-SUNWdsee-dsins1」として SMF に登録しています...
インスタンス /var/opt/SUNWdsee/dsins1 は SMF に登録されました
登録されたサービスを確認
# svcs -a | grep ds |
SMFでDirectory Serverインスタンスを起動# svcadm enable svc:/application/sun/ds:ds--var-opt-SUNWdsee-dsins1
# svcs -a | grep ds
legacy_run 16:30:12 lrc:/etc/rc2_d/S72utds
disabled 17:06:00 svc:/application/sun/ds:default
online 17:12:32 svc:/application/sun/ds:ds--var-opt-SUNWdsee-dsins1
name-service-cacheを再起動
この段階で、念のためName Service Cacheを再起動します。
| # svcadm restart svc:/system/name-service-cache:default |
LDAP search
インスタンスが起動後、先ほどのLDIFインポートにより登録されたエントリを検索してみます。
# ldapsearch -b "dc=example,dc=com" uid=gfarmer
version: 1
dn: uid=gfarmer, ou=People, dc=example,dc=com
cn: Gern Farmer
sn: Farmer
givenName: Gern
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
ou: Accounting
ou: People
l: Cupertino
uid: gfarmer
mail: gfarmer@example.com
telephoneNumber: +1 408 555 6201
facsimileTelephoneNumber: +1 408 555 8473
roomNumber: 1269
#
正しく検索できました。
idsconfig 実行
作成したDirectory Serverインスタンスを使用して、LDAPクライアントの
ログイン認証を行うために、idsconfigを実行します。
# cd /usr/lib/ldap
# ./idsconfig
It is strongly recommended that you BACKUP the directory server
before running idsconfig.
Hit Ctrl-C at any time before the final confirmation to exit.
Do you wish to continue with server setup (y/n/h)? [n] y
Enter the JES Directory Server's hostname to setup: funa
Enter the port number for iDS (h=help): [389]
Enter the directory manager DN: [cn=Directory Manager]
Enter passwd for cn=Directory Manager :
Enter the domainname to be served (h=help): [example.com]
Enter LDAP Base DN (h=help): [dc=example,dc=com]
Checking LDAP Base DN ...
Validating LDAP Base DN and Suffix ...
sasl/GSSAPI is not supported by this LDAP server
Enter the profile name (h=help): [default]
Default server list (h=help): [192.168.10.10]
Preferred server list (h=help):
Choose desired search scope (one, sub, h=help): [one]
The following are the supported credential levels:
1 anonymous
2 proxy
3 proxy anonymous
4 self
5 self proxy
6 self proxy anonymous
Choose Credential level [h=help]: [1] 2
The following are the supported Authentication Methods:
1 none
2 simple
3 sasl/DIGEST-MD5
4 tls:simple
5 tls:sasl/DIGEST-MD5
6 sasl/GSSAPI
Choose Authentication Method (h=help): [1] 2
Current authenticationMethod: simple
Do you want to add another Authentication Method? n
Do you want the clients to follow referrals (y/n/h)? [n]
Do you want to modify the server timelimit value (y/n/h)? [n] y
Enter the time limit for iDS (current=3600): [-1]
Do you want to modify the server sizelimit value (y/n/h)? [n] y
Enter the size limit for iDS (current=2000): [-1]
Do you want to store passwords in "crypt" format (y/n/h)? [n] n
Do you want to setup a Service Authentication Methods (y/n/h)? [n] y
Do you want to setup a Service Auth. Method for "pam_ldap" (y/n/h)? [n] y
The following are the supported Authentication Methods:
1 simple
2 sasl/DIGEST-MD5
3 tls:simple
4 tls:sasl/DIGEST-MD5
5 sasl/GSSAPI
Choose Service Authentication Method: [1] 1
Current authenticationMethod: pam_ldap:simple
Do you want to add another Authentication Method? n
Do you want to setup a Service Auth. Method for "keyserv" (y/n/h)? [n]
Do you want to setup a Service Auth. Method for "passwd-cmd" (y/n/h)? [n]
Client search time limit in seconds (h=help): [30]
Profile Time To Live in seconds (h=help): [43200]
Bind time limit in seconds (h=help): [10]
Do you wish to setup Service Search Descriptors (y/n/h)? [n]
Summary of Configuration
1 Domain to serve : example.com
2 Base DN to setup : dc=example,dc=com
3 Profile name to create : default
4 Default Server List : 192.168.10.10
5 Preferred Server List :
6 Default Search Scope : one
7 Credential Level : proxy
8 Authentication Method : simple
9 Enable Follow Referrals : FALSE
10 iDS Time Limit : -1
11 iDS Size Limit : -1
12 Enable crypt password storage : FALSE
13 Service Auth Method pam_ldap : pam_ldap:simple
14 Service Auth Method keyserv :
15 Service Auth Method passwd-cmd:
16 Search Time Limit : 30
17 Profile Time to Live : 43200
18 Bind Limit : 10
19 Service Search Descriptors Menu
Enter config value to change: (1-19 0=commit changes) [0]
Enter DN for proxy agent: [cn=proxyagent,ou=profile,dc=example,dc=com]
Enter passwd for proxyagent:
Re-enter passwd:
WARNING: About to start committing changes. (y=continue, n=EXIT) y
1. Changed timelimit to -1 in cn=config.
2. Changed sizelimit to -1 in cn=config.
3. Schema attributes have been updated.
4. Schema objectclass definitions have been added.
5. NisDomainObject added to dc=example,dc=com.
6. Top level "ou" containers complete.
7. automount maps: auto_home auto_direct auto_master auto_shared processed.
8. ACI for dc=example,dc=com modified to disable self modify.
9. Add of VLV Access Control Information (ACI).
10. Proxy Agent cn=proxyagent,ou=profile,dc=example,dc=com added.
11. Give cn=proxyagent,ou=profile,dc=example,dc=com read permission for password.
12. Generated client profile and loaded on server.
13. Processing eq,pres indexes:
uidNumber (eq,pres) Finished indexing.
ipNetworkNumber (eq,pres) Finished indexing.
gidnumber (eq,pres) Finished indexing.
oncrpcnumber (eq,pres) Finished indexing.
automountKey (eq,pres) Finished indexing.
14. Processing eq,pres,sub indexes:
ipHostNumber (eq,pres,sub) Finished indexing.
membernisnetgroup (eq,pres,sub) Finished indexing.
nisnetgrouptriple (eq,pres,sub) Finished indexing.
15. Processing VLV indexes:
example.com.getgrent vlv_index Entry created
example.com.gethostent vlv_index Entry created
example.com.getnetent vlv_index Entry created
example.com.getpwent vlv_index Entry created
example.com.getrpcent vlv_index Entry created
example.com.getspent vlv_index Entry created
example.com.getauhoent vlv_index Entry created
example.com.getsoluent vlv_index Entry created
example.com.getauduent vlv_index Entry created
example.com.getauthent vlv_index Entry created
example.com.getexecent vlv_index Entry created
example.com.getprofent vlv_index Entry created
example.com.getmailent vlv_index Entry created
example.com.getbootent vlv_index Entry created
example.com.getethent vlv_index Entry created
example.com.getngrpent vlv_index Entry created
example.com.getipnent vlv_index Entry created
example.com.getmaskent vlv_index Entry created
example.com.getprent vlv_index Entry created
example.com.getip4ent vlv_index Entry created
example.com.getip6ent vlv_index Entry created
idsconfig: Setup of iDS server funa is complete.
Note: idsconfig has created entries for VLV indexes. Use the
directoryserver(1m) script on funa to stop
the server and then enter the following vlvindex
sub-commands to create the actual VLV indexes:
directoryserver -s <server-instance> vlvindex -n example -T example.com.getgrent
directoryserver -s <server-instance> vlvindex -n example -T example.com.gethostent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getnetent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getpwent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getrpcent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getspent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getauhoent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getsoluent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getauduent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getauthent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getexecent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getprofent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getmailent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getbootent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getethent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getngrpent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getipnent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getmaskent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getprent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getip4ent
directoryserver -s <server-instance> vlvindex -n example -T example.com.getip6ent
#以上で、Directory Server 側のユーザログイン認証に必要な設定は完了です。
引き続き、今度はLDAPクライアント側の設定を行います。続きは、こちら。

















funasakiさん
質問がございます。
上記を参考にDirectryServer構築を進めているのですが、下記のようなエラーが出てしまいます。
一度目はインストールがうまくいかずにアンインストールし、今回が2度目となります。
エラー内容
--------------------------------------
bash-3.00# idsconfig
It is strongly recommended that you BACKUP the directory server
before running idsconfig.
Hit Ctrl-C at any time before the final confirmation to exit.
Do you wish to continue with server setup (y/n/h)? [n] y
Enter the JES Directory Server's hostname to setup: SAMPTEST01
Enter the port number for iDS (h=help): [389]
ERROR: Invalid host or port: SAMPTEST01:389, Please re-enter!
Enter the JES Directory Server's hostname to setup: [SAMPTEST01]
-----------------------------------------------
なお、/etc/defaultdomainと/etc/hostsの記述に関しては本手順書に沿っています。
原因として考えられるものがありましたらご教示お願いします。
以上、よろしくお願いします。
Posted by syo on 3月月 25日, 2008年 at 08:30 午後 JST #
こんにちは、
現在、社内で Sun Ray とか入れ始めてる今日この頃です。
で、Sun Ray サーバ(やその他 Unix 系)の認証を LDAP で統合しようと思っていたので、とても参考になりました。
今回こちらで示されている手順どおりにやってみたのですが、スキーマのインポート時はインスタンスを止めないとエラーになるみたいです。DS を止めればいいみたいなので、そのように手順を直しておいたほうがいいのではないかな、と思います。
あと、クライアントの設定後は、nscd を再起動しておいたほうがいいと思います。きっと初めて試す人は getent の結果が反映されなくてびっくりすると思うので。
Posted by tsucchi on 3月月 25日, 2008年 at 10:54 午後 JST #
syo さん
こんにちは、舟崎です。
idsconfig 実行時の iDS 用の port 番号の指定でエラーが出ているとのことですが、
こちらの port 番号は、「⑩Directory Server: インスタンス作成情報の指定」で
指定した番号を入れます。
既に 389 の port 番号を使用中の場合は、インスタンス作成時に別の番号を指定して、
そちらの番号を idsconfig 時に指定すると宜しいかと思います。
/etc/defaultdomain や /etc/hosts については、Directory Server インストール時に
通常は DNS を建てておく必要がありますが、今回は検証用ということで、
DNS サーバを使用せずに Directory Server を検証するための一時的な回避策ですので
通常は DNS サーバで名前解決が出来るようにする必要があります。こちらの点、ご注意
頂きたくお願いします。
Posted by funasaki on 3月月 27日, 2008年 at 10:48 午前 JST #
funasakiさん
お忙しいところ、ご丁寧なご回答ありがとうございます。
上記を参考にさせて頂きます。
今後もfunasaki's weblogとsolarisナイトセミナーを活用させて頂きます。
Posted by syo on 3月月 29日, 2008年 at 12:48 午前 JST #