尝试按照http://packaging.ubuntu.com/singlehtml/为某些软件创建 deb 包...
我必须先生成一个 GPG 密钥
$ gpg --gen-key
然后将密钥的公共部分上传到密钥服务器
$ gpg --send-keys --keyserver keyserver.ubuntu.com 12345678
gpg: sending key 12345678 to hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver send failed: keyserver error
尝试添加端口 80,因为我读到一些关于防火墙阻止这些请求的信息
gpg --send-keys --keyserver hkp://keyserver.ubuntu.com:80 C58C1F62
gpg: sending key C58C1F62 to keyserver.ubuntu.com:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
尝试了在网上搜索这些错误时找到的其他服务器
$ gpg --send-keys --keyserver sks-keyservers.net:80 12345678
gpg: sending key 12345678 to keyserver.sks-keyservers.net:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
$ gpg --send-keys --keyserver pgp.mit.edu:80 12345678
gpg: sending key 12345678 to pgp.mit.edu:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
也尝试过
gpg --send-keys --keyserver keyserver.pgp.com:80 12345678
gpg --send-keys --keyserver keyserver.sks-keyservers.net:80 12345678
(以防万一我需要“密钥服务器”这个东西)
全部都有同样的错误。
我错过了什么?
更新:更改了选项顺序并添加了 hkp:\ 协议 - 我仍然回到了开始的地方 - 消息略有改善
$ gpg --keyserver hkp://pool.sks-keyservers.net --send-keys 12345678
gpg: sending key 12345678to hkp server pool.sks-keyservers.net
gpg: keyserver timed out
gpg: keyserver send failed: keyserver error
编辑:我读到缺少的密钥服务器主机可能是一个错误消息,实际上意味着密钥在服务器上不存在......但是如果我发送它,它当然不存在。
gpg --send-keys --keyserver keyserver.ubuntu.com:80 C58C1F62
gpg: sending key C58C1F62 to keyserver.ubuntu.com:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
dig keyserver.ubuntu.com
; <<>> DiG 9.8.1-P1 <<>> keyserver.ubuntu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40676
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;keyserver.ubuntu.com. IN A
;; ANSWER SECTION:
keyserver.ubuntu.com. 217 IN A 91.189.90.55
keyserver.ubuntu.com. 217 IN A 91.189.89.49
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 30 12:41:52 2014
;; MSG SIZE rcvd: 70
这意味着服务器存在?但是问题部分看起来是空的……
gpg --send-keys --keyserver hkp://keyserver.ubuntu.com:80 C58C1F62
gpg: sending key C58C1F62 to hkp server keyserver.ubuntu.com
gpgkeys: HTTP post error 7: couldn't connect: eof
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
dig hkp://keyserver.ubuntu.com
; <<>> DiG 9.8.1-P1 <<>> hkp://keyserver.ubuntu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 968
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;hkp://keyserver.ubuntu.com. IN A
;; AUTHORITY SECTION:
ubuntu.com. 899 IN SOA ns1.canonical.com. hostmaster.canonical.com. 2014093001 10800 3600 604800 3600
;; Query time: 164 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 30 13:08:37 2014
;; MSG SIZE rcvd: 105
我还尝试添加代理选项......
gpg --keyserver-options http-proxy='http://10.1.1.1:1234/' --keyserver hkp://keyserver.ubuntu.com:80 --send-keys C58C1F62
gpg: sending key C58C1F62 to hkp server keyserver.ubuntu.com
gpgkeys: HTTP post error 7: couldn't connect: eof
gpg: keyserver internal error
gpg: keyserver send failed: keyserver error
答案1
有同样的问题。更改hkps
为hkp
:
gpg --keyserver hkp://hkps.pool.sks-keyservers.net --send-key
。并且有效。
答案2
存在多个问题:
选项
--keyserver
必须在 之前说明--send-keys
。--keyserver
需要包含协议的 URI。Ubuntu 密钥服务器的一个示例是--keyserver hkp://keyserver.ubuntu.com
您为 sks 密钥服务器网络使用了错误的主机。阅读https://sks-keyservers.net/overview-of-pools.php可用的池。最通用的(其他池大多按区域划分)是
pool.sks-keyservers.net
,您可以使用--keyserver hkp://pool.sks-keyservers.net