Red Hat Training

A Red Hat training course is available for RHEL 8

3.10. 使用私钥签名 GRUB 构建

在启用了 UEFI 安全引导机制的系统上,您可以使用自定义的现有私钥为 GRUB 构建签名。如果您使用自定义 GRUB 构建,或者已经从系统中删除 Microsoft 信任锚,则您必须执行此操作。

先决条件

流程

  • 在 x64 构架上:

    1. 创建一个签名的 GRUB EFI 二进制文件:

      # pesign --in /boot/efi/EFI/redhat/grubx64.efi \
               --out /boot/efi/EFI/redhat/grubx64.efi.signed \
               --certificate 'Custom Secure Boot key' \
               --sign

      Custom Secure Boot key 替换为您之前选择的名称。

    2. 可选:检查签名:

      # pesign --in /boot/efi/EFI/redhat/grubx64.efi.signed \
               --show-signature
    3. 使用签名的二进制文件覆盖未签名的二进制文件:

      # mv /boot/efi/EFI/redhat/grubx64.efi.signed \
           /boot/efi/EFI/redhat/grubx64.efi
  • 在 64 位 ARM 架构中:

    1. 创建一个签名的 GRUB EFI 二进制文件:

      # pesign --in /boot/efi/EFI/redhat/grubaa64.efi \
               --out /boot/efi/EFI/redhat/grubaa64.efi.signed \
               --certificate 'Custom Secure Boot key' \
               --sign

      Custom Secure Boot key 替换为您之前选择的名称。

    2. 可选:检查签名:

      # pesign --in /boot/efi/EFI/redhat/grubaa64.efi.signed \
               --show-signature
    3. 使用签名的二进制文件覆盖未签名的二进制文件:

      # mv /boot/efi/EFI/redhat/grubaa64.efi.signed \
           /boot/efi/EFI/redhat/grubaa64.efi