Kerberos V5 の構成
1. krb5-libs、krb5-server、および krb5-workstation パッケージをインストールします
2. /etc/krb5.conf を編集します および /var/kerberos/krb5kdc/kdc.conf レルム名とドメインからレルムへのマッピングを反映します。単純なレルムは、EXAMPLE.COM と example.com のインスタンスをドメイン名に置き換え (大文字と小文字を同じにするようにしてください)、kerberos.example.com をサーバーの完全修飾ホスト名に変更することで構築できます。
例:
# cat /etc/krb5.conf [logging] default = FILE:/var/log/krb5libs.log kdc = FILE:/var/log/krb5kdc.log admin_server = FILE:/var/log/kadmind.log [libdefaults] ticket_lifetime = 24000 default_realm = UK.ORACLE.COM [realms] UK.ORACLE.COM = { kdc = ukp9174.uk.oracle.com:88 admin_server = ukp9174.uk.oracle.com:749 default_domain = uk.oracle.com } [domain_realm] .uk.oracle.com = UK.ORACLE.COM uk.oracle.com = UK.ORACLE.COM [kdc] profile = /var/kerberos/krb5kdc/kdc.conf [pam] debug = false ticket_lifetime = 36000 renew_lifetime = 36000 forwardable = true krb4_convert = false
# cat /var/kerberos/krb5kdc/kdc.conf [kdcdefaults] kdc_ports = 88 acl_file = /var/kerberos/krb5kdc/kadm5.acl dict_file = /usr/dict/words admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab [realms] UK.ORACLE.COM = { master_key_type = des-cbc-crc database_name = /var/kerberos/krb5kdc/principal admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab supported_enctypes = des-cbc-crc:normal des3-cbc-raw:normal des3-cbc-sha1:norm al des-cbc-crc:v4 des-cbc-crc:afs3 kadmind_port = 749 acl_file = /var/kerberos/krb5kdc/kadm5.acl dict_file = /usr/dict/words }
3. /var/kerberos/krb5kdc/kadm5.acl を編集します。 どのプリンシパルが kerberos データベースにアクセスできるかを決定する
# vi /var/kerberos/krb5kdc/kadm5.acl */[email protected] *
4. kdb5_util コマンドを使用して、kerberos データベースを作成します。
# kdb5_util create -s Initializing database '/var/kerberos/krb5kdc/principal' for realm 'UK.ORACLE.COM', master key name 'K/[email protected]' You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key: admin Re-enter KDC database master key to verify: admin
5. Kerberos サービスを開始します:
# service krb5kdc start Starting Kerberos 5 KDC: [ OK ]
# service kadmin start Extracting kadm5 Service Keys Authenticating as principal root/[email protected] with password. Entry for principal kadmin/admin with kvno 3, encryption type DES cbc mode with CRC-32 added to keytab WRFILE:/var/kerberos/krb5kdc/kadm5.keytab. Entry for principal kadmin/admin with kvno 3, encryption type Triple DES cbc mode raw added to keytab WRFILE:/var/kerberos/krb5kdc/kadm5.keytab. Entry for principal kadmin/changepw with kvno 3, encryption type DES cbc mode with CRC-32 added to keytab WRFILE:/var/kerberos/krb5kdc/kadm5.keytab. Entry for principal kadmin/changepw with kvno 3, encryption type Triple DES cbc mode raw added to keytab WRFILE:/var/kerberos/krb5kdc/kadm5.keytab. [ OK ] Starting Kerberos 5 Admin Server [ OK ]
# service krb524 start Starting Kerberos 5-to-4 Server: [ OK ]
6. Kerberos プリンシパルを追加します:
# kadmin.local Authenticating as principal root/[email protected] with password. > kadmin.local: addprinc host/ukp9174.uk.oracle.com WARNING: no policy specified for host/[email protected]; defaulting to no policy Enter password for principal "host/[email protected]": admin Re-enter password for principal "host/[email protected]": admin Principal "host/[email protected]" created.ホストはサーバーのホスト名ではなく「ホスト」という単語であり、ukp9174.uk.oracle.com はサーバーの完全修飾ホスト名であることに注意してください。
> kadmin.local: addprinc root WARNING: no policy specified for [email protected]; defaulting to no policy Enter password for principal "[email protected]": admin Re-enter password for principal "[email protected]": admin Principal "[email protected]" created.
7. ホストをキータブに追加します:
# kadmin.local: ktadd -k /etc/krb5.keytab host/ukp9174.uk.oracle.com Entry for principal host/ukp9174.uk.oracle.com with kvno 2, encryption type DES cbc mode with CRC-32 added to keytab WRFILE:/etc/krb5.keytab. Entry for principal host/ukp9174.uk.oracle.com with kvno 2, encryption type Triple DES cbc mode raw added to keytab WRFILE:/etc/krb5.keytab. > kadmin.local: exit
8. チケットを取得できるかどうかをテストします:
# kinit Password for [email protected]: admin
9. チケットを持っていることを証明する:
# klist Ticket cache: FILE:/tmp/krb5cc_0 Default principal: [email protected] Valid starting Expires Service principal 01/02/01 11:14:15 01/02/01 21:14:15 krbtgt/[email protected] Kerberos 4 ticket cache: /tmp/tkt0
これが機能するようになったら、正しくセットアップされたことになります。