Show Table of Contents
16.4. 複数のサーバー向けの既存の keytab 取得
クラスターの環境などのシナリオでは、共通のホスト名を使用するサービスに対して、異なるマシンで同じ keytab ファイルが必要な場合があります。各ホストで同じ keytab を取得するには、IdM コマンドを使用することができます。
共通のホスト名とサービスプリンシパルを準備するには、IdM サーバーで以下のコマンドを実行します。
adminユーザーとして認証を行います。[root@ipaserver ~]# kinit admin
- このホスト名を共有する全 IP アドレスに対して、共通の正引き DNS レコードを追加します。
[root@ipaserver ~]# ipa dnsrecord-add idm.example.com cluster --a-rec={192.0.2.40,192.0.2.41} Record name: cluster A record: 192.0.2.40, 192.0.2.41 - 共通の DNS 名に対して新規ホストエントリーオブジェクトを作成します。
[root@ipaserver ~]# ipa host-add cluster.idm.example.com ------------------------------------ Added host "cluster.idm.example.com" ------------------------------------ Host name: cluster.idm.example.com Principal name: host/cluster.idm.example.com@IDM.EXAMPLE.COM Password: False Keytab: False Managed by: cluster.idm.example.com
- ホストのサービスプリンシパルを追加します。
[root@ipaserver ~]# ipa service-add HTTP/cluster.idm.example.com ------------------------------------------------------------ Added service "HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM" ------------------------------------------------------------ Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com
- IdM から keytab を取得できるようにサービスにホストを追加します。
[root@ipaserver ~]# ipa service-allow-retrieve-keytab HTTP/cluster.idm.example.com --hosts={node01.idm.example.com,node02.idm.example.com} Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com Hosts allowed to retrieve keytab: node01.idm.example.com, node02.idm.example.com ------------------------- Number of members added 2 ------------------------- - 新規 keytab 作成パーミッションをホスト 1 台に割り当てます。
[root@ipaserver ~]# ipa service-allow-create-keytab HTTP/cluster.idm.example.com --hosts=node01.idm.example.com Principal: HTTP/cluster.idm.example.com@IDM.EXAMPLE.COM Managed by: cluster.idm.example.com Hosts allowed to retrieve keytab: node01.idm.example.com, node02.idm.example.com Hosts allowed to create keytab: node01.idm.example.com ------------------------- Number of members added 1 -------------------------
クライアントで以下の手順を実行します。
- ホストの Kerberos keytab で認証を行います。
# kinit -kt /etc/krb5.keytab
- 適切なパーミッションを割り当てたクライアントで、新規 keytab を生成して、ファイルに保存します。
[root@node01 ~]# ipa-getkeytab -s ipaserver.idm.example.com -p HTTP/cluster.idm.example.com -k /tmp/client.keytab
- このコマンドに
-rオプションを追加して、IdM サーバーから既存の keytab を取得します。[root@node02 ~]# ipa-getkeytab -r -s ipaserver.idm.example.com -p HTTP/cluster.idm.example.com -k /tmp/client.keytab
警告
-rオプションを省略すると、新しい keytab が生成される点に注意してください。これにより、このサービスプリンシパル用に以前に取得した keytab はすべて無効になります。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.