“gpg:解密失败:没有密钥”在另一个系统上
我试图使用GPG(也已与GPG加密)在新系统上使用GPG(也已加密GPG加密)来解密密码。我没有格式化 /家庭部分来保留所需的一切(配置,密码,.gnupg,.password-store等)。我认为我已经尝试了所有事情,但这一切都以 gpg:解密失败:没有秘密键。对不起,如果我没有告诉您您期望的更多信息,但是您可以告诉我您确切需要什么,我会为您提供一切。
这个问题存在,它在2017年得到了解决,但它根本没有帮助我。对不起,如果我有问题,因为我做错了什么。谢谢您
有这样的文件:〜/.password-store/.gpg-id。以前将.gnupg从备份复制到〜/,并使用命令 sudo chown -r leo:staff〜/.gnupg (Leo是我坐在的新系统上的用户现在),我使用.GPG文件-ID(3D8ABF94A4E38339)的内容进行以下操作:
- $ GPG -Export 3D8ABF94A4E4E38339> pub.key
- $ gpg- export-secret-keys 3d8abf94a4e38339> sec.key
- gpg:密钥3D8ABF94A4E38339/82E95B5A6D369E55:错误从代理获取键:无效的参数 - 跳过
- $ gpg -import pub.key
- GPG:key gpg:key 3d8abf94a4a4e4e4e4ee383339:未更改
- GPG:处理总数:1 -GPG:不变:1
- $ gpg -Import sec.key
- GPG:键3D8ABF94A4E38339:“ Leonid< ma1l>”未更改
- GPG:密钥3D8ABF94A4E38339:秘密钥匙导入
- GPG:处理总数:1 -GPG:不变:1
- GPG:秘密键阅读:1
- GPG:秘密键不变:1
- $ PASS -C社交/Spotify
- GPG:解密失败:没有秘密钥匙
我不知道第三个是什么从上到下的线,但在我看来这很重要,整个问题都在其中。我认为问题在于秘密键,因为这是解密的必要条件。加密某些文件(使用-Recipient 3D8ABF94A4E38339选项),我看不到任何错误(在此处使用公共,因此一切都可以),当解密(带有相同选项)时,最后一行会出现。
我认为我的错误是我使用错误的秘密密钥(是的,我的猜测很奇怪),但是要完全确定,我需要知道哪个秘密密钥属于特定的加密文件(很可能,很可能, “所有权”在这里不存在,MB,我错了),至少我知道它正在访问哪个私钥。但是,另一方面,密钥ID(.GPG-ID)已经在.Password-store目录中。顺便说一句,在导出密钥秘密时,我需要输入密码。正是我早些时候在另一个系统上使用的密码来访问密码。也就是说,这是我似乎已经导出了正确的秘密键的信号。
基本上,我不知道该怎么办。我搜索了这个问题,在SOF上看到了它,但是该解决方案对我不起作用(实际上我描述了一行更高)。我对所有文件,配置等都有未触及的备份,但是我不知道如何正确使用所有这些。请帮我
I'm trying to decrypt passwords in pass using gpg (they were also encrypted with gpg) on a new system with a new user. I did not format the /home section to keep everything I need (configs, passwords, .gnupg, .password-store, etc.). I think I've already tried everything, but it all ends with the gpg: decryption failed: No secret key. Sorry if I didn't tell some more information you expected, but you can tell me what do you exactly need and I'll get everything for you.
This question exists and it was solved in 2017, but it didn't help me at all. Sorry if I have that problem just because i did something wrong. And thank you
There was such a file: ~/.password-store/.gpg-id. Having previously copied the .gnupg from the backup to ~/ and using the command sudo chown -R leo:staff ~/.gnupg (leo is a user on the new system on which I'm sitting right now), I did the following using the contents of the .gpg file -id(3D8ABF94A4E38339):
- $ gpg --export 3D8ABF94A4E38339 > pub.key
- $ gpg --export-secret-keys 3D8ABF94A4E38339 > sec.key
- gpg: key 3D8ABF94A4E38339/82E95B5A6D369E55: error getting keyinfo from agent: Invalid argument - skipped
- $ gpg --import pub.key
- gpg: key 3D8ABF94A4E38339: "Leonid <ma1l>" not changed
- gpg: Total number processed: 1
-gpg: unchanged: 1 - $ gpg --import sec.key
- gpg: key 3D8ABF94A4E38339: "Leonid <ma1l>" not changed
- gpg: key 3D8ABF94A4E38339: secret key imported
- gpg: Total number processed: 1
-gpg: unchanged: 1 - gpg: secret keys read: 1
- gpg: secret keys unchanged: 1
- $ pass -c social/spotify
- gpg: decryption failed: No secret key
I don't know what the third line from top to bottom means, but it seems to me that it is important, and the whole problem lies in it. I think that the problem is with the secret key, because it is necessary for decryption. Encrypting some file (with the --recipient 3D8ABF94A4E38339 option), I don't see any errors (public is used here, so everything is ok with it), and when decrypting (with the same option), the last line comes out.
I think my mistake is that I am using the wrong secret key (yes, my guesses are strange), but to be completely sure of this, I need to know which secret key belongs to a particular encrypted file (most likely, the concepts of "ownership " doesn't exist here though, mb, I'm wrong), at least id know which private key it's accessing. But, on the other hand, the key id (.gpg-id) is already in the .password-store directory. BTW, when exporting the key secret, I needed to enter a passphrase. It was this passphrase that I used earlier on another system to access my passwords. That is, this is a sign that I seem to have exported the correct secret key.
Basically, I don't know what to do. I googled that problem, saw it on SOF, but the solution didn't work for me(actually I described that one some lines higher). I have an untouched backup with all files, configs, etc., but I don't know how to properly use all this. Help me please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论