Solaris のシステム管理 (ネーミングとディレクトリサービス : DNS、NIS、LDAP 編)

第 15 章 Sun ONE Directory Server の設定 (手順)

この章では、Sun ONE Directory Server (以前の名称は iPlanet Directory Server) を構成して、Solaris LDAP ネームサービスクライアントのネットワークをサポートする方法について説明します。 この情報は、Sun ONE Directory Server に固有の情報です。


注 –

Solaris LDAP クライアントで動作するよう Sun ONE Directory Server を構成する前に、第 11 章に記載された手順をすべて実行する必要があります。



注 –

ディレクトリサーバー (LDAP サーバー) を、サーバー自身のクライアントにすることはできません。


この章の内容は次のとおりです。

idsconfig を使用した Sun ONE Directory Server の構成

サーバーのインストール用チェックリストの作成

サーバーのインストール処理時に定義する重要な変数を使用して、以下に示すようなチェックリストを作成してから、idsconfig を起動してください。 記入用のチェックリスト で提供されるチェックリストを使用できます。


注 –

以下の情報は、以降の LDAP 関連の章に示されるすべての例の基礎になります。 サンプルのドメインは、全国規模で店舗を展開する部品会社である Example, Inc. のものです。 例の中では、その West Coast Division (ドメインは west.example.com) を対象に説明します。


表 15–1 サーバーで定義する変数

変数 

サンプルネットワークの定義 

インストールしたディレクトリサーバーインスタンスのポート番号 (デフォルト = 389) 

default

サーバー名  

myserver (完全指定ドメイン名 ipdserver.west.example.com または 192.168.0.0)

複製サーバー (IP 番号: ポート番号) 

192.168.0.1 [ipdrep.west.example.com 用]

ディレクリマネージャ [dn: cn=directory manager]

default

サービスされるドメイン名  

west.example.com

クライアント要求の処理がタイムアウトするまでの時間 (秒) 

–1

各検索要求で返されるエントリの最大数 

–1


注 –

defaultServerList または preferredServerList の定義でホスト名を使用する場合、ホストの検索に LDAP を使用してはなりません。 これは、/etc/nsswitch.confhosts 行に ldap を含めることはできないことを意味します。


表 15–2 クライアントプロファイルで定義する変数

変数 

サンプルネットワークの定義 

プロファイル名 

WestUserProfile

サーバーリスト (デフォルトはローカルサブネット) 

west.example.com または 192.168.0.0

優先されるサーバーリスト (優先順に記載) 

none

検索範囲 (検索するディレクトリツリーレベルの数、 「One」 (デフォルト) または「Sub」)

one (デフォルト)

サーバーへのアクセスに使用する資格。 デフォルトは anonymous

proxy

参照に従うか (メインサーバーが使用できない場合の別のサーバーへのポインタ)。デフォルトは no

Y

検索時にサーバーが情報を返すまでの待機時間の制限 (デフォルトは 30) 

default

サーバーとの通信時のバインド時間の制限 (デフォルトは 10 秒)。 デフォルトは秒 

2

認証方式。 デフォルトは none

simple


注 –

クライアントプロファイルはドメインごとに定義されます。 指定されたドメインで、1 つ以上のプロファイルを定義する必要があります。


属性インデックス

idsconfig が作成する次の属性リストにより、 パフォーマンスが向上します。

membernisnetgroup

pres,eq,sub

nisnetgrouptriple

pres,eq,sub

memberuid

pres,eq

uidNumber

pres,eq

gidNumber

pres,eq

ipHostNumber

pres,eq

ipNetworkNumber

pres,eq

ipProtocolNumber

pres,eq

oncRpcNumber

pres,eq

スキーマ定義

idsconfig(1M) により、必要なスキーマ定義が自動的に追加されます。 LDAP 管理に精通しているユーザー以外、サーバースキーマを手動で変更してはなりません。 LDAP ネームサービスの使用するスキーマ拡張リストについては、第 18 章「LDAP の一般的なリファレンス 」を参照してください。

インデックス表示の使用

インデックス表示は、Sun ONE Directory Server の機能で、仮想リスト表示とも呼ばれます。 クライアントは、インデックス表示を使用して、エントリのグループや番号の記載された長いリストを表示して選択を実行できます。 このため、各クライアントの検索処理時間を短縮できます。 インデックス表示により最適化かつ事前定義された検索パラメータが提供されるため、Solaris LDAP ネームクライアントは、さまざまなサービスから特定の情報により素早くアクセスできるようになります。 インデックス表示を作成しない場合、サーバーが検索時間を制限するために、クライアントが指定されたタイプのエントリすべてを取得できない場合があります。また、エントリの番号を確認できない場合もあります。

インデックスはディレクトリサーバー上に構成されるため、プロキシユーザーはこれらのインデックスに読み取りアクセス権限を保持します。

Sun ONE Directory Server 上でインデックス表示を構成する前に、これらのインデックスの使用に関連したパフォーマンスのコストを検討してください。 詳細については、ご使用のバージョンの Sun ONE Directory Server の『管理者ガイド』を参照してください。

次の例では、-n オプションでエントリをインデックス化するデータベースの名前を示し、-s オプションでディレクトリサーバーのインスタンスを示します。


注 –

idsconfig により、デフォルト VLV インデックスがすべて作成されます。


directoryserver -s ipdserver vlvindex -n userRoot -T getgrent
directoryserver -s ipdserver vlvindex -n userRoot -T gethostent
directoryserver -s ipdserver vlvindex -n userRoot -T getnetent
directoryserver -s ipdserver vlvindex -n userRoot -T getpwent
directoryserver -s ipdserver vlvindex -n userRoot -T getrpcent
directoryserver -s ipdserver vlvindex -n userRoot -T getspent


サービス検索記述子を使用してさまざまなサービスへのクライアントアクセスを変更する

サービス検索記述子 (SSD) を使用すると、LDAP 内の指定された操作のデフォルト検索要求を、ユーザーが定義した検索に変更できます。 たとえば、これまでカスタマイズしたコンテナ定義や別のオペレーティングシステムで LDAP を使用してきたユーザーが、Solaris 9 に移行する場合などに、SSD は特に役に立ちます。SSD を使用すると、既存の LDAP データベースおよびデータを変更せずに、Solaris 9 LDAP ネームサービスを構成できます。

idsconfig を使用して SSD を変更する

前出の Example, Inc. が LDAP を構成済みで、ユーザーを ou=Users コンテナに格納しているものとします。 これをSolaris 9 にアップグレードしましょう。定義では、Solaris 9 LDAP は、ユーザーエントリが ou=People コンテナに格納されていると想定しています。 このままでは、LDAP は passwd サービス検索時に DIT の ou=people レベルを検索するため、適切な値を検出できません。

この問題を解決する手のかかる方法の 1 つは Example, Inc. の既存のDIT を完全に置き換え、Example, Inc. のネットワーク上の既存アプリケーションすべてを書き換えて、新規 LDAP ネームサービスとの互換性を持たせる方法です。 別のはるかに望ましい解決策は、SSD を使用して、LDAP に対しユーザー情報をデフォルトの ou=people コンテナ内ではなく ou=Users コンテナ内で検索するよう指示する方法です。

idsconfig を使用して、Sun ONE Directory Server の構成時に必要な SSD を定義します。 プロンプト行は次のようになります。


Do you wish to setup Service Search Descriptors (y/n/h? y
  A  Add a Service Search Descriptor
  D  Delete a SSD
  M  Modify a SSD
  P  Display all SSD's
  H  Help
  X  Clear all SSD's

  Q  Exit menu
Enter menu choice: [Quit] a
Enter the service id: passwd
Enter the base: service ou=user,dc=west,dc=example,dc=com
Enter the scope: one[default]
  A  Add a Service Search Descriptor
  D  Delete a SSD
  M  Modify a SSD
  P  Display all SSD's
  H  Help
  X  Clear all SSD's

  Q  Exit menu
Enter menu choice: [Quit] p

Current Service Search Descriptors:
==================================
Passwd:ou=Users,ou=west,ou=example,ou=com?

Hit return to continue.

  A  Add a Service Search Descriptor
  D  Delete a SSD
  M  Modify a SSD
  P  Display all SSD's
  H  Help
  X  Clear all SSD's

  Q  Exit menu
Enter menu choice: [Quit] q

idsconfig の実行


注 –

idsconfig の実行には特別な権限は不要であり、LDAP ネームサービスクライアントになる必要もありません。 idsconfig を実行する準備として、サーバーのインストール用チェックリストの作成 で説明したチェックリストを作成してください。 idsconfig を、サーバーまたは LDAP ネームサービスクライアントマシンから 実行する必要はありません。 ネットワーク上の任意の Solaris マシンから idsconfig を実行できます。



注意 – 注意 –

idsconfig は、ディレクトリマネージャのパスワードを平文で送信します。 これを防ぐには、idsconfig をクライアント上ではなく ディレクトリサーバー上で実行する必要があります。


idsconfig を使用して Sun ONE Directory Server を構成する方法
  1. ターゲットの Sun ONE Directory Server が起動して実行中であることを確認してください。

  2. idsconfig を実行します。


    # /usr/lib/ldap/idsconfig
    
  3. 表示される質問に答えます。

    ユーザー入力のデフォルトは「no」です。 質問の詳細を表示する場合は、


    h
    
    と入力します。すると、簡単なヘルプが表示されます。

以下の idsconfig の実行例を参照する際、この章の冒頭の サーバーのインストール用チェックリストの作成 で示したサーバーおよびクライアントのチェックリスト内の定義を使用してください。 以下は、デフォルト設定の多くを変更しない単純な設定の例です。 クライアントプロファイルを変更する最も複雑な方法は、SSD を作成する方法です。 詳細については、サービス検索記述子を使用してさまざまなサービスへのクライアントアクセスを変更するを参照してください。

プロンプトの後のキャリッジリターンは、Enter キーを押してデフォルトの設定を受け入れたことを意味します。


例 15–1 Example, Inc. ネットワークでの idsconfig の実行


# 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 directory server's 
hostname to setup: myserver

Enter the port number for  directory server (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): [west.example.com] 
Enter LDAP Base DN (h=help): [dc=west,dc=example,dc=com] 
Enter the profile name (h=help): [default] 
Default server list (h=help): [192.168.0.0] 
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
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
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] Y

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] Y

Do you want to setup a Service Authentication Methods (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] 2

Do you wish to setup Service Search Descriptors (y/n/h)? [n] 
 
              Summary of Configuration

  1  Domain to serve               : west.example.com
  2  Base DN to setup              : dc=west,dc=example,dc=com
  3  Profile name to create        : default
  4  Default Server List           : 192.168.0.0
  5  Preferred Server List         : 
  6  Default Search Scope          : one
  7  Credential Level              : proxy
  8  Authentication Method         : simple
  9  Enable Follow Referrals       : TRUE
 10  iDS Time Limit                : -1
 11  iDS Size Limit                : -1
 12  Enable crypt password storage : TRUE
 13  Service Auth Method pam_ldap  : 
 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                    : 2
 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=west,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. Changed passwordstoragescheme to "crypt" in cn=config.
4. Schema attributes have been updated.
5. Schema objectclass definitions have been added.
6. Created DN component dc=west.
7. NisDomainObject added to dc=west,dc=example,dc=com.
8. Top level "ou" containers complete.
9. Nis maps: auto_home auto_direct auto_master auto_shared processed.
10. ACI for dc=west,dc=example,dc=com modified to disable self modify.
11. Add of VLV Access Control Information (ACI).
12. Proxy Agent cn=proxyagent,ou=profile,dc=west,dc=example,dc=com added.
13. Give cn=proxyagent,ou=profile,dc=west,dc=example,dc=com read permission for 
password.
14. Generated client profile and loaded on server.
15. Processing eq,pres indexes:
      ipHostNumber (eq,pres)   Finished indexing.
      uidNumber (eq,pres)   Finished indexing.
      ipNetworkNumber (eq,pres)   Finished indexing.
      gidnumber (eq,pres)   Finished indexing.
      oncrpcnumber (eq,pres)   Finished indexing.
16. Processing eq,pres,sub indexes:
      membernisnetgroup (eq,pres,sub)   Finished indexing.
      nisnetgrouptriple (eq,pres,sub)   Finished indexing.
17. Processing VLV indexes:
      west.example.com.getgrent vlv_index   Entry created
      west.example.com.gethostent vlv_index   Entry created
      west.example.com.getnetent vlv_index   Entry created
      west.example.com.getpwent vlv_index   Entry created
      west.example.com.getrpcent vlv_index   Entry created
      west.example.com.getspent vlv_index   Entry created

idsconfig: Setup of directory server ipdserver is complete.


Note: idsconfig has created entries for VLV indexes.  Use the
      directoryserver(1m) script on ipdserver to stop
      the server and then enter the following vlvindex
      sub-commands to create the actual VLV indexes:

  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.getgrent
  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.gethostent
  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.getnetent
  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.getpwent
  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.getrpcent
  directoryserver -s ipdserver vlvindex -n userRoot -T west.example.com.getspent


注 –

サマリー画面で空欄になっているパラメータは設定されません。


idsconfig によるディレクトリの設定が完了したら、サーバー設定を完了してサーバーをクライアント対応にする前に、サーバー上で指定されたコマンドを実行する必要があります。

ldapaddent を使用したディレクトリサーバーの生成


注 –

pam_unix を使用している場合、データを使用してディレクトリサーバーを生成する前に、パスワードを Unix Crypt 形式で格納するようにサーバーを構成する必要があります。 pam_ldap を使用している場合、任意の形式でパスワードを格納できます。 UNIX crypt 形式でパスワードを設定する方法については、Sun ONE Directory Server のマニュアルを参照してください。


ldapaddent は、標準入力から (/etc/filename passwd など) データを読み取り、このデータをサービスに関連付けられたコンテナに配置します。 クライアント構成により、デフォルトのデータ書き込み方法が決定されます。


注 –

ldapaddent(1M) は、LDAP ネームサービス用に構成済みのクライアントでのみ実行できます。


ldapaddent を使ったユーザーパスワードデータによる Sun ONE Directory Server の生成方法
  1. ldapaddent コマンドを使用して、/etc/passwd エントリをサーバーに追加します。

    # ldapaddent -D "cn=directory manager" -f /etc/passwd passwd

ldapaddent(1M) のマニュアルページを参照してください。 LDAP セキュリティおよび Directory Server への書き込みアクセスの詳細については、第 13 章「基本コンポーネントおよび概念 (概要)」を参照してください。

プリンタエントリの管理

プリンタの追加

プリンタエントリを LDAP ディレクトリに追加する場合、printmgr 構成ツールまたは lpset -n ldap コマンド行ユーティリティを使用します。 詳細については、lpset(1M) のマニュアルページを参照してください。 ディレクトリに追加されるプリンタオブジェクトは、プリンタの印刷システムクライアントが必要とする接続パラメータのみを定義することに留意してください。 ローカルのプリントサーバー構成データはファイル内に保持されます。 典型的なプリンタエントリは、次のようになります。


printer-uri=myprinter,ou=printers,dc=mkg,dc=example,dc=com
objectclass=top
objectclass=printerService
objectclass=printerAbstract
objectclass=sunPrinter
printer-name=myprinter
sun-printer-bsdaddr=printsvr.example.com,myprinter,Solaris
sun-printer-kvp=description=HP LaserJet (PS)
printer-uri=myprinter

lpget の使用

lpget(1M) を使用して、LDAP クライアントの LDAP ディレクトリが認識するプリンタエントリすべてをリスト表示できます。 LDAP クライアントの LDAP サーバーが複製サーバーの場合、更新複製規約 (update replication agreement) によって、リスト表示されたプリンタはマスター LDAP サーバーのプリンタと同じでない場合があります。 詳細については、lpget(1M) のマニュアルページを参照してください。

たとえば、指定されたベース DN のプリンタすべてを一覧表示するには、次のように入力します。

# lpget -n ldap list


myprinter:
	dn=myprinter,ou=printers,dc=mkt,dc=example,dc=com
	bsdaddr=printsvr.example.com,myprinter,Solaris
	description=HP LaserJet (PS)

追加プロファイルを使用してディレクトリサーバーを生成する

ldapclientgenprofile オプションとともに使用すると、指定された属性に基づいて、構成プロファイルの LDIF 表現を作成できます。 作成したプロファイルは、次に LDAP サーバーに読み込まれ、クライアントプロファイルとして使用されます。 クライアントプロファイルは、 ldapclient init を使うことによりクライアントからダウンロードできます。

ldapclient genprofile の使用方法の詳細については、ldapclient(1M) のマニュアルページを参照してください。

ldapclient を使った追加プロファイルによるディレクトリサーバーの生成方法
  1. スーパーユーザーになります。

  2. ldapclient コマンドを genprofile オプションとともに使用します。

    # ldapclient genprofile -a profileName=myprofile \

    -a defaultSearchBase=dc=west,dc=example,dc=com \

    -a "defaultServerList=192.168.0.0 192.168.0.1:386" \

    > myprofile.ldif

  3. 新規プロファイルをサーバーにアップロードします。

    # ldapadd –h 192.168.0.0 —D “cn=directory manager” —f myprofile.ldif

ディレクトリサーバーを構成してパスワード管理を有効にする

pam_ldap が正しく動作するには、パスワードとアカウントのロックアウトポリシーがサーバー上で正しく構成されている必要があります。 ディレクトリサーバーコンソール または ldapmodify を使用して、LDAP ディレクトリのパスワード管理ポリシーを構成できます。 手順と詳細については、ご使用のバージョンの Sun ONE Directory Server の『管理者ガイド』の「ユーザーアカウントの管理」の章を参照してください。

proxy ユーザー用のパスワードは、期限が切れてはいけません。 proxy パスワードが期限切れになった場合、 proxy 資格レベルを使用するクライアントはサーバーからネームサービス情報を取り出すことができません。 proxy ユーザーのパスワードの期限が切れないことを保証するために、以下のスクリプトを記述して proxy アカウントを変更します。


# ldapmodify -h ldapserver —D administrator DN \
-w  administrator password <<EOF 
dn: proxy user DN
DNchangetype: modify
replace: passwordexpirationtime
passwordexpirationtime: 20380119031407Z
EOF

注 –

pam_ldap のパスワード管理は、Sun ONE Directory Server をもとに古くなったパスワードやアカウントの期限切れ情報を維持し、ユーザーに知らせます。 ディレクトサーバーは、ユーザーアカウントを有効にするシャドウエントリから対応するデータを解釈しません。 しかし、pam_unix がシャドウデータを調査して、アカウントがロックされているか、パスワードが古くなっているかを判断します。 LDAP ネームサービスやディレクトリサーバーはシャドウデータを最新の状態に維持しているわけではないので、pam_unix はシャドウデータにもとづいたアクセスを許可するべきではありません。 シャドウデータは proxy 識別情報を使って検出します。 そのため、proxy ユーザーに userPassword 属性へ読み取りアクセスを許可しないでください。 proxy ユーザーを userPassword へ読み取りアクセスさせないことにより、 pam_unix が無効なアカウントの検証を行わないようになります。