我使用一个严格锁定的 Linux 系统,该系统带有 GRUB 内置的验证启动机制。因此,/boot
每次我想要摆弄它时(这种情况相当常见),我都必须对内核、GRUB 模块和配置文件进行签名。对它们进行签名需要我使用 GPG,最初我无法让它加载我的私钥,直到我了解到我需要使用sudo -E
。
我可以签署文件,但是我收到大量这样的警告:
gpg: WARNING: unsafe permissions on configuration file `/home/user/.gnupg/gpg.conf
我想通过保留环境变量(我已经这样做了)来消除这个问题,同时让 GPG 认为配置文件上有“安全权限”。我不想将我的 GPG 密钥移动到 root 文件夹。有什么办法可以实现吗?
答案1
您是否尝试过 的gpg
手册页中的此选项?我在该页面上搜索“unsafe”(听起来很熟悉,可能是浏览时发现的)时发现了此错误
--no-permission-warning
Suppress the warning about unsafe file and home directory
(--homedir) permissions. Note that the permission checks that
GnuPG performs are not intended to be authoritative, but rather
they simply warn about certain common permission problems. Do
not assume that the lack of a warning means that your system is
secure.
Note that the warning for unsafe --homedir permissions cannot be
suppressed in the gpg.conf file, as this would allow an attacker
to place an unsafe gpg.conf file in place, and use this file to
suppress warnings about itself. The --homedir permissions warn‐
ing may only be suppressed on the command line.
或者也许制作一些 gpg 文件的根文件夹副本,仅用于检查签名?