在 2.1.15 中使用 gpg-preset-passphrase 缓存通过 pinentry 输入的密码需要哪些步骤?

use*_*922 11 gpg gpg-agent

我正在寻求缓存密码以在无人值守的机器上使用。由于这样做带来了一些风险,我宁愿选择哪些密码短语获取缓存,避免设置都default-cache-ttlmax-cache-ttl到令人讨厌的高值,以及避免需要清除gpg-agent定期的整个高速缓存-因此,我正在寻找一个解决方案gpg-preset-passphrase。我在故障排除时发现的一些信息参考了旧版本的 GnuPG,所以我不确定我是否已经充分考虑了所有差异。

首先,按照 的规定man 1 gpg-agentexport GPG_TTY=$(tty)我的 .bashrc 中有。

现在假设我运行eval $(gpg-agent --daemon --allow-preset-passphrase --default-cache-ttl 1 --max-cache-ttl 31536000)以启动 gpg-agent,注意到gpg-preset-passphrase 仍然支持 --max-cache-ttl(默认 2 小时)。

然后我$KEYGRIPgpg --with-keygrip -K.

有了这个,我试试/path/to/gpg-preset-passphrase -c $KEYGRIP。点击返回后,将打印:

   gpg-preset-passphrase: caching passphrase failed: Not implemented
Run Code Online (Sandbox Code Playgroud)

再次尝试添加--verbose --debug 6 --log-file /path/to/gpg-agent.loggpg-agent,我的日志附加了

   gpg-agent[4206] listening on socket /run/user/1000/gnupg/S.gpg-agent
   gpg-agent[4207] gpg-agent (GnuPG) 2.1.15 started
   gpg-agent[4207] handler 0x7f86ef783700 for fd 5 started
   gpg-agent[4207] command PRESET_PASSPHRASE failed: Not implemented
   gpg-agent[4207] handler 0x7f86ef783700 for fd 5 terminated
Run Code Online (Sandbox Code Playgroud)

除了深入研究源头之外,我不确定从哪里开始,所以我想知道是否有人可以首先纠正我正在采取的步骤。

hol*_*lms 0

我也遇到了这个问题,我已经通过向 gpg-agent 添加配置解决了,你可以在这里找到它:

/sf/ask/3464417561/