生成gpg密钥时“无此文件或目录”


21

我正在尝试生成一个gpg密钥

$ gpg --full-gen-key

但最终我得到一个错误

gpg: agent_genkey failed: No such file or directory
Key generation failed: No such file or directory

我在Arch Linux上。

$ gpg --version
gpg (GnuPG) 2.1.15
libgcrypt 1.7.3
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/me123/.gnupg
.............

目录/home/me123/.gnupg存在


3
运行strace -o /tmp/foo gpg --full-gen-key,然后查看输出。然后应清除找不到的文件或目录。
史蒂夫

1
如果不解决这个问题,你也可以开始gpg-agent使用strace,以防万一错误来自有:pkill gpg-agent; strace -o /tmp/gpg-agent.trace gpg-agent --daemon
Matei David

Answers:



14

可能似乎未创建目录〜/ .gnupg / private-keys-v1.d(在某些情况下),或者目录权限错误。

# mkdir -p ~/.gnupg/private-keys-v1.d
# chmod 700 ~/.gnupg/private-keys-v1.d

为我修复它。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.