同じサーバー上に KDC と OpenLDAP をインストールすると、パフォーマンスが向上します。
同じサーバー上に KDC と OpenLDAP を構成する際に必要となる主な手順は、次のとおりです。
OpenLDAP パッケージのインストール
パスへの OpenLDAP ユーティリティーの配置
OpenLDAP サーバーの構成と、そのディレクトリの保護
OpenLDAP デーモンの起動
OpenLDAP サーバーへの組織エントリの追加
KDC 構成ファイルへの OpenLDAP サーバーの追加
Kerberos データベースの作成
OpenLDAP サーバーへの KDC 役割および kadmin 役割の追加
Kerberos データベースキーの作成
マスター KDC のクロックとクロック同期サーバーとの同期
KDC および kadmin サービスの有効化
この手順では、同じシステム上に KDC マスターと OpenLDAP サーバーを構成します。KDC では、OpenLDAP クライアントライブラリが使用され、あとで構成する Kerberos クライアントも使用されます。
始める前に
DNS を使用するようにシステムが構成されていることを確認してください。この手順では、LDAP に OpenLDAP を使用します。詳細は、OpenLDAP のホームページを参照してください。
root に含まれています。詳細は、Oracle Solaris 11.3 でのユーザーとプロセスのセキュリティー保護 の 割り当てられている管理権利の使用を参照してください。
# pkg install library/openldap
# export PATH="/usr/lib/openldap/bin:$PATH"
ドメインを変更し、スキーマ、アクセス、およびインデックスの情報を追加します。
# 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 ...
# 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
# pfedit /usr/share/lib/ldif/kerberos.ldif # cp /usr/share/lib/ldif/kerberos.ldif /etc/openldap/schema/kerberos.schema
# /usr/lib/slapd -u openldap -g openldap -f /etc/openldap/slapd.conf \ -h "ldapi:/// ldaps:///"
OpenLDAP デーモンは、ポート 389 を待機します。デフォルトでは、ドメインソケットの場所は /var/openldap/run/ldapi です。
# pfedit /etc/openldap/ldap.conf URI ldapi:/var/openldap/run/ldapi
# /usr/lib/openldap/bin/ldapsearch -Y EXTERNAL -D "cn=directory manager" -b "" \ -s base '(objectclass=*)' namingContexts
# 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
# 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:/// } ...
# 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) のマニュアルページを参照してください。
# 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
# 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
# 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"
認証が成功するには、すべてのクロックが、krb5.conf ファイルの libdefaults セクションで定義されているデフォルトの時間内に収まっている必要があります。詳細は、krb5.conf(4) のマニュアルページおよびKDC と Kerberos クライアントのクロックの同期化を参照してください。
# svcadm enable krb5kdc # svcadm enable kadmin