AFAIK 关于 gpg/pgp 的基本概念是,对于想要在他们之间建立信任的两个人来说,都是发布公钥和私钥(私钥由创建它的用户保存,不共享),并且具有强度(一次 1024 位,现在 4096 位,将来 8192 位,依此类推)。
现在,他们两个需要将其公钥发布到密钥服务器(类似于电话簿),并提供指向发布这些密钥的密钥服务器的链接。
现在如果我去服务器说https://pgp.mit.edu/寻找阿什什 我需要很多
https://pgp.mit.edu/pks/lookup?op=get&search=ashish&op=index
假设我想要的 Ashish 是这个 DAD95197 (只是一个例子)我将如何导入该公钥?
我确实尝试过
└─[$] gpg --keyserver pgp.mit.edu --recv-keys DAD95197
gpg: keyserver receive failed: No keyserver available
但可以看出,这不起作用。
答案1
gpg --keyserver pgp.mit.edu --recv-keys DAD95197
是应该DAD95197
从 MIT 密钥服务器导入匹配的密钥。然而,MIT 密钥服务器经常存在可用性问题,因此配置另一个密钥服务器更安全。
我一般用SKS 池;以下是搜索“ashish”的结果。要从那里导入密钥,请运行
gpg --keyserver pool.sks-keyservers.net --recv-keys FBF1FC87DAD95197
(切勿使用短密钥 ID,它们很容易被欺骗)。
这个答案解释如何配置 GnuPG 安装以始终使用 SKS 池。
答案2
麻省理工学院的服务器似乎超时了。您还可以尝试手动复制 ashish.gpg 文件中的关键内容
$ cat ashish.gpg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.6
Comment: Hostname: pgp.mit.edu
mQINBFrGqCABEAC53n1+JJKaE6bHDMr4SccDgN8dOw3gLIkiQYyjv6AoP4kQ82MmxDiwDUQE
ufhry/NHcsxAePcHLTvMHH5YhsHkcChfd/J8q6CsY1vYCALGMhCYMuUEaE74H3k3Eg1eRSdm
ddgni5Jmu6RqK23pdTvu3SnYyQSI+15xtqd+XFRuT5Wkwci6j+UNXjDBcHjjAYhN5qZOGwCX
UwgcNykgDK6ZeT5HOQOGnx1d/nt4wI+Er9r0UzlROTwpMsx3t194DpQ5pSln3h937hACfIkB
YDl/s2rgRFha1Wm4DOKxrzS7ISlxp6j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