Go to main content
Oracle® Solaris 11.3 での Kerberos およびその他の認証サービスの管理

印刷ビューの終了

更新: 2017 年 3 月
 
 

OpenLDAP ディレクトリサーバー上でのマスター KDC の構成

同じサーバー上に KDC と OpenLDAP をインストールすると、パフォーマンスが向上します。

    同じサーバー上に KDC と OpenLDAP を構成する際に必要となる主な手順は、次のとおりです。

  1. OpenLDAP パッケージのインストール

  2. パスへの OpenLDAP ユーティリティーの配置

  3. OpenLDAP サーバーの構成と、そのディレクトリの保護

  4. OpenLDAP デーモンの起動

  5. OpenLDAP サーバーへの組織エントリの追加

  6. KDC 構成ファイルへの OpenLDAP サーバーの追加

  7. Kerberos データベースの作成

  8. OpenLDAP サーバーへの KDC 役割および kadmin 役割の追加

  9. Kerberos データベースキーの作成

  10. マスター KDC のクロックとクロック同期サーバーとの同期

  11. KDC および kadmin サービスの有効化

OpenLDAP ディレクトリサーバー上でマスター KDC を構成する方法

この手順では、同じシステム上に KDC マスターと OpenLDAP サーバーを構成します。KDC では、OpenLDAP クライアントライブラリが使用され、あとで構成する Kerberos クライアントも使用されます。

始める前に

DNS を使用するようにシステムが構成されていることを確認してください。この手順では、LDAP に OpenLDAP を使用します。詳細は、OpenLDAP のホームページを参照してください。

root に含まれています。詳細は、Oracle Solaris 11.3 でのユーザーとプロセスのセキュリティー保護 の 割り当てられている管理権利の使用を参照してください。

  1. openldap パッケージをインストールします。
    # pkg install library/openldap
  2. パスに OpenLDAP ユーティリティーを追加します。
    # export PATH="/usr/lib/openldap/bin:$PATH"
  3. 構成ファイル slapd.conf を編集して、OpenLDAP サーバーの構成を開始します。

    ドメインを変更し、スキーマ、アクセス、およびインデックスの情報を追加します。

    # pfedit /etc/openldap/slapd.conf
    include         /etc/openldap/schema/core.schema
    include         /etc/openldap/schema/cosine.schema
    include         /etc/openldap/schema/inetorgperson.schema
    include         /etc/openldap/schema/nis.schema
    include         /etc/openldap/schema/kerberos.schema
    
    ...
    
    access to dn.base=""
        by * read
    
    access to dn.base="cn=Subschema"
        by * read
    
    access to attrs=userPassword,userPKCS12
        by self write
        by * auth
    
    access to attrs=shadowLastChange
        by self write
        by * read
    
    # Providing access to realm container
    access to dn.subtree="cn=EXAMPLE.COM,cn=krbcontainer,dc=example,dc=com"
        by dn.exact="cn=kdc service,dc=example,dc=com" read
        by dn.exact="cn=kadmin service,dc=example,dc=com" write
        by * none
    
    # Providing access to principals, if not underneath realm container
    access to dn.subtree="ou=users,dc=example,dc=com"
        by dn.exact="cn=kdc service,dc=example,dc=com" read
        by dn.exact="cn=kadmin service,dc=example,dc=com" write
        by * none
    
    access to *
        by * read
    
    ...
    
    index   krbPrincipalName
    
    ...
  4. OpenLDAP ディレクトリ上でアクセス権を変更します。
    # chown -R openldap:openldap /var/openldap
    # chown openldap:openldap /etc/openldap/slapd.conf
    # mkdir /var/openldap/openldap-data
    # chown openldap:openldap /var/openldap/openldap-data
  5. dn および changetype を削除し、kerberos.ldif ファイルに特別な行を追加してから、その行を kerberos.schema ファイルにコピーします。
    # pfedit /usr/share/lib/ldif/kerberos.ldif
    # cp /usr/share/lib/ldif/kerberos.ldif /etc/openldap/schema/kerberos.schema
  6. ドメインソケットをサポートするための特定の引数を使用して、OpenLDAP デーモンを起動します。
    # /usr/lib/slapd -u openldap -g openldap -f /etc/openldap/slapd.conf \
       -h "ldapi:/// ldaps:///"

    OpenLDAP デーモンは、ポート 389 を待機します。デフォルトでは、ドメインソケットの場所は /var/openldap/run/ldapi です。

  7. /etc/openldap/ldap.conf ファイルで、クライアントのドメインソケットの場所を指定します。
    # pfedit /etc/openldap/ldap.conf
    URI     ldapi:/var/openldap/run/ldapi
  8. slapd デーモンが IPC を使用して、ドメインソケットを待機していることを確認します。
    # /usr/lib/openldap/bin/ldapsearch -Y EXTERNAL -D "cn=directory manager" -b "" \
       -s base '(objectclass=*)' namingContexts
  9. OpenLDAP サーバーに組織エントリを追加します。
    # pfedit entries.ldif
    dn: dc=example,dc=com
    objectClass: dcObject
    objectClass: organization
    o: example.com
    dc: example
    
    dn: ou=groups,dc=example,dc=com
    objectClass: top
    objectClass: organizationalunit
    ou: groups
    
    dn: ou=users,dc=example,dc=com
    objectClass: top
    objectClass: organizationalunit
    ou: users
    
    # ldapadd -D "cn=directory manager,dc=example,dc=com" -W -f entries.ldif
  10. Kerberos 構成ファイルに OpenLDAP サーバーを追加します。
    # pfedit /etc/krb5/krb5.conf
     [realms]
             EXAMPLE.COM = {
                     kdc = krb1.example.com
                     admin_server = krb1.example.com
                     database_module = LDAP
             }
    
     [dbmodules]
             LDAP = {
                     db_library = kldap
                     ldap_kerberos_container_dn = "cn=krbcontainer,dc=example,dc=com"
                     ldap_kdc_dn = "cn=kdc service,ou=profile,dc=example,dc=com"
                     ldap_kadmind_dn = "cn=kadmin service,ou=profile,dc=example,dc=com"
                     ldap_cert_path = /var/ldap
                     ldap_servers = ldapi:///
             }
      ...
  11. Kerberos データベースに LDAP エントリを作成します。
    # kdb5_ldap_util -D "cn=directory manager,dc=example,dc=com" create \
       -subtrees ou=users,dc=example,dc=com -r EXAMPLE.COM -s

    詳細は、kdb5_ldap_util(1M) のマニュアルページを参照してください。

  12. OpenLDAP 構成に Kerberos エントリを追加します。
    1. 初期プロファイルを作成し、追加します。
      # pfedit profile.ldif
      dn: ou=profile,dc=example,dc=com
      ou: profile
      objectclass: top
      objectclass: organizationalUnit
      
      # ldapadd -D "cn=directory manager,dc=example,dc=com" -W -f profile.ldif
    2. KDC 役割および kadmin 役割を作成し、追加します。
      # pfedit kdc_roles.ldif
       dn: cn=kdc service,ou=profile,dc=example,dc=com
       cn: kdc service
       sn: kdc service
       objectclass: top 
       objectclass: person
       userpassword: nnnnnnnn
       
       dn: cn=kadmin service,ou=profile,dc=example,dc=com
       cn: kadmin service
       sn: kadmin service
       objectclass: top
       objectclass: person
       userpassword: nnnnnnnn
      
      # ldapadd -D "cn=directory manager,dc=example,dc=com" -W -f kdc_roles.ldif
  13. KDC および kadmin サービスへの LDAP バインディング用の stash ファイルを作成します。
    # kdb5_ldap_util -D "cn=directory manager,dc=example,dc=com" stashsrvpw \
       cn="kdc service,ou=profile,dc=example,dc=com"
    # kdb5_ldap_util -D "cn=directory manager,dc=example,dc=com" stashsrvpw \
       cn="kadmin service,ou=profile,dc=example,dc=com"
  14. このシステムのクロックをレルム内のほかのクロックと同期します。

    認証が成功するには、すべてのクロックが、krb5.conf ファイルの libdefaults セクションで定義されているデフォルトの時間内に収まっている必要があります。詳細は、krb5.conf(4) のマニュアルページおよびKDC と Kerberos クライアントのクロックの同期化を参照してください。


    注 -  マスター KDC をクロック同期サーバーにすることはできません。
  15. KDC および kadmin サービスを有効にします。
    # svcadm enable krb5kdc
    # svcadm enable kadmin