如何在 Ubuntu 14.04 下禁用私有存储库的 apt 密钥检查?

Ada*_*son 5 updates apt repository gnupg 14.04

在 Ubuntu 14.04 下,我无法让它工作。

我们的 PCI 审计员告诉我们我们不能直接出站访问 Ubuntu 存储库,所以我用 reprepro 镜像它们。同样,我们没有对 keyserver.ubuntu.com 的出站访问权限。

我尝试将以下各项添加到/etc/apt/apt.conf.d/99local

APT::Get::AllowUnauthenticated "true";
APT{Ignore {"gpg-pubkey"; }};
APT { Get { AllowUnauthenticated "1"; }; };
Run Code Online (Sandbox Code Playgroud)

阅读软件包后,“apt-get update”仍然返回:

W: GPG error: hkp://sa1.dal.some-company.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 082BCA0181FE8E68
W: GPG error: hkp://sa1.dal.some-company.com trusty-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 082BCA0181FE8E68
W: GPG error: hkp://sa1.dal.some-company.com trusty-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 082BCA0181FE8E68
W: GPG error: hkp://sa1.dal.some-company.com trusty-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 082BCA0181FE8E68
Run Code Online (Sandbox Code Playgroud)

如何让这个工作?我在文档中没有找到有关如何禁用密钥检查的内容。

Jen*_*rat 1

因为安装了本地存储库而禁用签名验证就像因为你围住了花园而移除了门锁。不要这样做,尤其是在需要增强安全性的环境中!

您不需要访问密钥服务器即可安装用于在 reprepro 中对数据包进行签名的公钥。只需将密钥文件复制到相应的计算机,然后使用如下命令导入它

sudo apt-key add [publickey]
Run Code Online (Sandbox Code Playgroud)

while[publickey]是包含 ID 为密钥的文件082BCA0181FE8E68。您可以在生成密钥的计算机上生成这样的文件

gpg --armor --export 082BCA0181FE8E68 >082BCA0181FE8E68.asc
Run Code Online (Sandbox Code Playgroud)

公钥可以任意共享,因为它只能用于验证使用私钥发出的签名。添加密钥只需使用存储库在每台计算机上执行一次。