リポジトリメタデータ

リポジトリメタデータを署名できるようにするにはカスタムGPGキーが必要です。

To access a shell inside the Server container run mgrctl term on the container host.

Procedure: Generating a custom GPG key
  1. As the root user, use the gpg command to generate a new key:

    mgrctl exec -it -- gpg --full-generate-key
  2. At the prompts, select RSA as the key type, with a size of 2048 bits, and select an appropriate expiry date for your key. Check the details for your new key, and type y to confirm.

  3. プロンプトが表示されたら、キーに関連付けられた名前と電子メールアドレスを入力します。 You can also add a comment to help you identify the key, if desired. When you are happy with the user identity, type O to confirm.

  4. プロンプトが表示されたら、キーを保護するパスフレーズを入力します。

  5. キーは自動的にキーリングに追加されます。 キーリングにキーを一覧表示して確認できます。

    mgrctl exec -- gpg --list-keys
  6. Add the password for your keyring to the /etc/rhn/signing.conf configuration file, by opening the file in your text editor and adding this line:

    GPGPASS="password"

GPGキーの更新については、同期のトラブルシューティングを参照してください。

You can manage metadata signing on the command line using the mgr-sign-metadata-ctl command.

Procedure: Enabling metadata signing
  1. 使用するキーの短い識別子を知っている必要があります。 使用可能な公開鍵を短い形式で一覧表示できます。

    mgrctl exec -- gpg --keyid-format short --list-keys
    ...
    pub   rsa4096/3E7BFE0A 2019-04-02 [SC] [expires: 2029-04-01]
          A43F9EC645ED838ED3014B035CFA51BF3E7BFE0A
    uid         [ultimate] SUSE Manager
    sub   rsa4096/118DE7FF 2019-04-02 [E] [expires: 2029-04-01]
  2. Enable metadata signing with the mgr-sign-metadata-ctl command:

    mgrctl exec -- mgr-sign-metadata-ctl enable 3E7BFE0A
    OK. Found key 3E7BFE0A in keyring.
    DONE. Set key 3E7BFE0A in /etc/rhn/signing.conf.
    DONE. Enabled metadata signing in /etc/rhn/rhn.conf.
    DONE. Exported key 3E7BFE0A to /srv/susemanager/salt/gpg/mgr-keyring.gpg.
    DONE. Exported key 3E7BFE0A to /var/spacewalk/gpg/<KEY_NAME>.key.
    NOTE. For the changes to become effective run:
       mgr-sign-metadata-ctl regen-metadata
  3. このコマンドを使用して設定が正しいことを確認できます。

    mgrctl exec -- mgr-sign-metadata-ctl check-config
  4. Restart the container for the configuration changes to be detected.

    mgradm restart
  5. Schedule metadata regeneration to replace all metadata with new signed versions.

    mgrctl exec -- mgr-sign-metadata-ctl regen-metadata

You can also use the mgr-sign-metadata-ctl command to perform other tasks. Use mgr-sign-metadata-ctl --help to see the complete list.

リポジトリメタデータ署名はグローバルオプションです。 有効にすると、サーバ上のすべてのソフトウェアチャンネルで有効になります。 これは、サーバに接続されているすべてのクライアントが、パッケージをインストールまたは更新できるようにするために、新しいGPGキーを信頼する必要があることを意味します。

Procedure: Importing GPG keys on clients
  1. GPGキーをクライアントに配備すると、salt状態で動作します。

  2. SUSE Multi-Linux Manager Web UIを使用してhighstateを適用します。

GPGキーのトラブルシューティングの詳細については、同期のトラブルシューティングを参照してください。