第11章 Red Hat Update Infrastructure Server のクライアントプロファイルの作成
11.1. GPG キーの生成 リンクのコピーリンクがクリップボードにコピーされました!
手順
Red Hat Update Infrastructure (RHUI) クライアントプロファイルのカスタムパッケージ (クライアント設定 RPM を含む) の署名に使用できる GPG キーを作成します。
- このプロファイルは、Red Hat Enterprise Linux (RHEL) 6 または RHEL 7 で実行する RHUI サーバーに使用されるため、4,096 ビット RSA キーが使用されます。特に Red Hat Update Appliance (RHUA) が仮想マシンの場合は、4,096 ビットの鍵を生成するのに十分なランダムデータを収集するのに大量の時間がかかることがあります。リポジトリーまたはコンテンツ配信サーバー (CDS) の同期により作成されるディスクアクティビティーにより、プロセスが速くなる場合があります。
クライアントプロファイル RPM (この場合は
rhui-client-rhui) の名前 (後述) が、ユーザー ID のコメント部分として使用されます。各クライアントプロファイルには異なる署名鍵を使用することが推奨されます。異なる鍵のユーザー ID を識別するには、クライアントプロファイル名を使用します。# gpg --gen-key gpg (GnuPG) 2.0.14; Copyright (C) 2009 Free Software Foundation, Inc. This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: 1. RSA and RSA (default) 2. DSA and Elgamal 3. DSA (sign only) 4. RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) 4096 Requested keysize is 4096 bits Please specify how long the key should be valid. 0 = key does not expire = key expires in n days w = key expires in n weeks m = key expires in n months y = key expires in n years Key is valid for? (0) 0 Key does not expire at all. Is this correct? y GnuPG needs to construct a user ID to identify your key. Real name: $YOURNAME Email address: $USER@$HOST.com Comment: rhui-client-rhui You selected this user ID: “$USERID (rhui-client-rhui) <$USER@$HOST.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key.
高品質のパスワードを入力し、安全な場所に記録します。
gpg: key EDD092F4 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 4096R/EDD092F4 2015-11-25 Key fingerprint = 1139 932A 26E2 981A 1341 D636 0DDB B5F6 EDD0 925F4 uid Red Hat $USERID (rhui-client-rhui) <user@redhat.com> Note that this key cannot be used for encryption. You may want to use the command “--edit-key” to generate a subkey for this purpose.-
次のキーを作成します。この時間には、キータイプとしてオプション 3、DSA (署名のみ) を選択し、1024 ビットをキーサイズとして入力します。これらのオプションは、RHEL6 および RHEL7 の RPM に署名するために使用できるキーを作成します。
rhui-client-allをユーザー ID のコメント部分として使用します。 2 つのキーをエクスポートします。
# mkdir /root/rpm-gpg # gpg --export --armor rhui-client-rhui >> /root/rpm-gpg/rhui-client-rhui # gpg --export --armor rhui-client-all >> /root/rpm-gpg/rhui-client-allGPG では、鍵の検索時に、デフォルトで部分文字列マッチが使用されます。ユーザー ID の一意の部分 (この場合はクライアントプロファイルの RPM 名) のみを指定する必要があります。Red Hat Update Infrastructure Management Tool がクライアント設定パッケージを作成するときに、従来の RPM-GPG-KEY- 接頭辞が GPG 鍵ファイル名に追加されます。