我设法以装甲文本格式从 gpg 导出我的密钥,并将它们导入 Mozilla Thunderbird,包括公钥和私钥。
有没有办法避免这个过程,让 Mozilla Thunderbird 直接与 gpg 通信?
我注意到,当我加密消息时,Mozilla Thunderbird 不会询问我私钥的密码。所以我假设 Mozilla Thunderbird 将它存储在某个地方。Thunderbird 将我的私钥密码存储在哪里,是否以纯文本形式保存?我不希望它以纯文本形式存储
我设法以装甲文本格式从 gpg 导出我的密钥,并将它们导入 Mozilla Thunderbird,包括公钥和私钥。
有没有办法避免这个过程,让 Mozilla Thunderbird 直接与 gpg 通信?
我注意到,当我加密消息时,Mozilla Thunderbird 不会询问我私钥的密码。所以我假设 Mozilla Thunderbird 将它存储在某个地方。Thunderbird 将我的私钥密码存储在哪里,是否以纯文本形式保存?我不希望它以纯文本形式存储
在新的 ubuntu 20.10 虚拟机上为本地存储库设置密钥,我收到一条消息,提示 apt-key add 已弃用,我应该阅读apt-key
(8) 手册页。( apt-key
8) 手册页是串在一起的单词的集合,但如果它包含信息,我就无法将其剔除。谁能告诉我,我应该在终端上输入什么,而不是:
apt-key add name-of-file
在向我鸣喇叭后,该命令显然仍然有效,所以我能够继续,但想知道我将来需要做什么。
我正在尝试从Microsoft APT 存储库安装一些软件包(因为我非常讨厌 Snap!)但我似乎无法添加它的密钥:
$ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
它说好的,但钥匙不起作用:
$ sudo apt update
[...]
Err:7 https://packages.microsoft.com/repos/vscode stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Reading package lists... Done
W: GPG error: https://packages.microsoft.com/repos/vscode stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
E: The repository 'https://packages.microsoft.com/repos/vscode stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
我还尝试从 apt-get 打印的 NO_PUBKEY id 开始检索密钥:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EB3E94ADBE1229CF
Executing: /tmp/apt-key-gpghome.q9IjlmqKv9/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv EB3E94ADBE1229CF
gpg: key EB3E94ADBE1229CF: "Microsoft (Release signing) <[email protected]>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
它说“没有改变”,事实上,什么都没有改变。
如果我检查输出apt-key list
我看到所有第三方密钥都有一个sub rsa4096
除了微软的。这就是它不起作用的原因吗?
$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2017-05-08 [SCEA]
1EDD E2CD FC02 5D17 F6DA 9EC0 ADAE 6AD2 8A8F 901A
uid [ unknown] Sublime HQ Pty Ltd <[email protected]>
sub rsa4096 2017-05-08 [S]
pub rsa4096 2016-04-12 [SC]
EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796
uid [ unknown] Google Inc. (Linux Packages Signing Authority) <[email protected]>
sub rsa4096 2019-07-22 [S] [expires: 2022-07-21]
pub rsa4096 2014-06-13 [SC]
9FD3 B784 BC1C 6FC3 1A8A 0A1C 1655 A0AB 6857 6280
uid [ unknown] NodeSource <[email protected]>
sub rsa4096 2014-06-13 [E]
pub rsa2048 2015-10-28 [SC]
BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
uid [ unknown] Microsoft (Release signing) <[email protected]>
[...]
我该如何解决这个问题?
Ubuntu 20.04 焦点
我无法正确重建 /etc/apt/trusted.gpg 密钥环:
$ sudo rm /etc/apt/trusted.gpg
rm: remove regular file ‘/etc/apt/trusted.gpg’? y
$ sudo apt-key update 2>&1 | egrep "gpg:.*(invalid|failed)"
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
$ apt-key list >/dev/null
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_search_next failed: invalid packet
编辑 1:我找到了这个 pb。与 中的钥匙圈有关/etc/apt/trusted.gpg.d/
,因此我使用以下方法重新创建了它们add-apt-repository
:
$ sudo mv /etc/apt/trusted.gpg.d /etc/apt/trusted.gpg.d.BACKUP
$ sudo mkdir /etc/apt/trusted.gpg.d
$ time awk -F / '/^deb .*ppa.launchpad.net/{print "sudo add-apt-repository -y ppa:"$4"/"$5}' /etc/apt/sources.list.d/*.list | sh -x
+ sudo add-apt-repository -y ppa:aims/sagemath
gpg: keyring `/tmp/tmpv9cab2oz/secring.gpg' created
gpg: keyring `/tmp/tmpv9cab2oz/pubring.gpg' created
gpg: requesting key BE796FF2 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpv9cab2oz/trustdb.gpg: trustdb created
gpg: key BE796FF2: public key "Launchpad PPA for AIMS" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
+ sudo add-apt-repository -y ppa:apandada1/brightness-controller
gpg: keyring `/tmp/tmp74ndc3fv/secring.gpg' created
gpg: keyring `/tmp/tmp74ndc3fv/pubring.gpg' created
gpg: requesting key A7803E3B from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp74ndc3fv/trustdb.gpg: trustdb created
gpg: key A7803E3B: public key "Launchpad PPA for Archisman Panigrahi" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
...
gpg: /tmp/tmp49wcgvjj/trustdb.gpg: trustdb created
gpg: key EEAD66BD: public key "Launchpad PPA for Xu Zhen" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
real 6m20.794s
user 5m49.528s
sys 0m17.888s
$ apt-key list >/dev/null
gpg: keyblock resource `/etc/apt/trusted.gpg.d/notepadqq-team-notepadqq.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/nowrep-qupzilla.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/octave-stable.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/openlp-core-release.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/otto-kesselgulasch-gimp.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pinta-maintainers-pinta-stable.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pmjdebruijn-gnoduino-release.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/privoox-privoox.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pypy-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/rvm-smplayer.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/sbates-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/smathot-cogscinl.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ufleisch-kid3.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/unit193-inxi.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/wseverin-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg': resource limit
经过一番挖掘,我发现 GnuPG v1(Ubuntu Trust APT 数据包的依赖项)不能处理超过 40 个密钥环,也就是说,它不能处理超过 39 个密钥环/etc/apt/trusted.gpg.d/
(根据这个:https://askubuntu .com/a/508337/426176和那个:https ://www.mail-archive.com/[email protected]/msg23302.html )
编辑 2:我删除了 10 个重复的键/etc/apt/trusted.gpg.d/
:
$ sudo fdupes -rnASd /etc/apt/trusted.gpg.d
[1] /etc/apt/trusted.gpg.d/guardianproject-fdroidserver.gpg
[2] /etc/apt/trusted.gpg.d/guardianproject-ppa.gpg
Set 1 of 6, preserve files [1 - 2, all] (916 bytes each): 2
[-] /etc/apt/trusted.gpg.d/guardianproject-fdroidserver.gpg
[+] /etc/apt/trusted.gpg.d/guardianproject-ppa.gpg
[1] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-3.gpg
[2] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-4.gpg
[3] /etc/apt/trusted.gpg.d/jonathonf-texlive.gpg
[4] /etc/apt/trusted.gpg.d/jonathonf-vim.gpg
[5] /etc/apt/trusted.gpg.d/jonathonf-vlc.gpg
Set 2 of 6, preserve files [1 - 5, all] (1135 bytes each): 2
[-] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-3.gpg
[+] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-4.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-texlive.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-vim.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-vlc.gpg
[1] /etc/apt/trusted.gpg.d/noobslab-apps.gpg
[2] /etc/apt/trusted.gpg.d/noobslab-mint.gpg
[3] /etc/apt/trusted.gpg.d/noobslab-themes.gpg
Set 3 of 6, preserve files [1 - 3, all] (943 bytes each): 2
[-] /etc/apt/trusted.gpg.d/noobslab-apps.gpg
[+] /etc/apt/trusted.gpg.d/noobslab-mint.gpg
[-] /etc/apt/trusted.gpg.d/noobslab-themes.gpg
[1] /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
[2] /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg
Set 4 of 6, preserve files [1 - 2, all] (6570 bytes each): 1
[+] /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
[-] /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg
[1] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg
[2] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
Set 5 of 6, preserve files [1 - 2, all] (1313 bytes each): 2
[-] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg
[+] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
[1] /etc/apt/trusted.gpg.d/mc3man-mpv-tests.gpg
[2] /etc/apt/trusted.gpg.d/mc3man-trusty-media.gpg
Set 6 of 6, preserve files [1 - 2, all] (527 bytes each): 2
[-] /etc/apt/trusted.gpg.d/mc3man-mpv-tests.gpg
[+] /etc/apt/trusted.gpg.d/mc3man-trusty-media.gpg
将我所有的 gpg 启动板 ppa 密钥添加到同一个/etc/apt/trusted.gpg
密钥环中是唯一的解决方案吗,它似乎没有那么有序?
编辑 3:现在我有 16 个额外的(被拒绝的)钥匙/etc/apt/trusted.gpg.d/
,所以我要把它们移到/etc/apt/trusted.gpg
钥匙圈:
$ apt-key list 2>&1 >/dev/null | awk -F"[\`']" '/resource limit/{print "sudo apt-key add "$2" 2>/dev/null ; sudo \\rm -vf "$2}' | sh -x
+ sudo apt-key add /etc/apt/trusted.gpg.d/pypy-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/pypy-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/pypy-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/rvm-smplayer.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/rvm-smplayer.gpg
removed ‘/etc/apt/trusted.gpg.d/rvm-smplayer.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/sbates-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/sbates-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/sbates-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg
removed ‘/etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/smathot-cogscinl.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/smathot-cogscinl.gpg
removed ‘/etc/apt/trusted.gpg.d/smathot-cogscinl.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg
removed ‘/etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg
removed ‘/etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg
removed ‘/etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
removed ‘/etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg
removed ‘/etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ufleisch-kid3.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ufleisch-kid3.gpg
removed ‘/etc/apt/trusted.gpg.d/ufleisch-kid3.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/unit193-inxi.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/unit193-inxi.gpg
removed ‘/etc/apt/trusted.gpg.d/unit193-inxi.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
removed ‘/etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/wseverin-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/wseverin-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/wseverin-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg
removed ‘/etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg’
$ apt-key list >/dev/null
$
问题已解决。
我正在尝试准备我的 Ubuntu 18.04 的备份,包括Seahorse Keyrings。为此,我使用rsync将/home/user/.local/share/keyrings/的内容复制到我的 NAS。
然后我将此数据复制到另一台装有 Ubuntu 18.04 的计算机上,但Seahorse会忽略包含*.keyring -files 的密码。如果我手动尝试导入它们Seahorse输出此错误消息:
<file>.keyring
Could not display "<file>.keyring"
Reason: Unrecognised or supported data.
看起来像这里描述的加密问题。但是特别是密钥环的解密不是一种选择。
恢复备份密钥环或将其传输到另一台计算机的适当方法是什么?
由于某种原因,我正在尝试将 openprinting 存储库(http://www.openprinting.org/download/printdriver/debian lsb3.2)添加到我的计算机上,但我下载的密钥(Release.gpg)不起作用。我不断收到此错误:gpg:未找到有效的 OpenPGP 数据。
此外,当我尝试在没有密钥的情况下进行更新时,我得到以下信息: W:GPG 错误:http ://www.openprinting.org/download/printdriver/debian lsb3.2 发布:由于公钥无法验证以下签名不可用:NO_PUBKEY 24CBF5474CFD1E2F
所以我尝试通过以下方式添加密钥: sudo apt-key adv --keyserver pgp.key-server.io --recv-keys 24CBF5474CFD1E2F
结果:执行:/tmp/apt-key-gpghome.NPs0VC8DiH/gpg.1.sh --keyserver pgp.key-server.io --recv-keys 24CBF5474CFD1E2F gpg: key 24CBF5474CFD1E2F: public key "OpenPrinting (OpenPrinting Key) " 导入的 gpg: 处理的总数: 1 gpg: 导入的: 1
但是当我运行更新时,我得到这个: W:GPG 错误:http ://www.openprinting.org/download/printdriver/debian lsb3.2 发布:以下签名无效:F8897B6F00075648E248B7EC24CBF5474CFD1E2F
有任何想法吗 ?