首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gpg-agent正在运行,但总是提示我输入密码。

gpg-agent正在运行,但总是提示我输入密码。
EN

Unix & Linux用户
提问于 2018-10-10 00:26:22
回答 1查看 2K关注 0票数 2

当我运行gpg2时,每次使用它时都会被提示输入密码。根据我对gpg-agent手册页的阅读,应该只在第一次提示我。

代码语言:javascript
复制
gpg-agent  is a daemon to manage secret (private)
keys independently from any proto-col. It is
used as a backend for gpg and gpgsm as well as
for  a  couple  of other utilities.

The agent is automatically started on demand
by gpg, gpgsm, gpgconf, or gpg-connect-agent.
Thus there is no reason to start it manually.

...

--default-cache-ttl n
    Set the time a cache entry is valid to n
    seconds.  The default  is  600  sec- onds.
    Each  time a cache entry is accessed, the
    entry's timer is reset.  To set an entry's
    maximum lifetime, use max-cache-ttl.

--max-cache-ttl n
    Set the maximum time a cache entry is valid
    to n seconds.  After this time  a cache
    entry will be expired even if it has been
    accessed recently or has been set using
    gpg-preset-passphrase.  The default is 2
    hours (7200 seconds).

如果我正确地读取了它,调用gpg2应该在我第一次使用它时提示输入密码,那么,如果我在接下来的600秒内再次运行它,我将不会再次被提示。正在运行

代码语言:javascript
复制
gpg2 --export-secret-keys --armor john.doe@example.com > /dev/null

给我这个:

代码语言:javascript
复制
┌─┐
│ Please enter the passphrase to export the OpenPGP secret key:  │
│ "John Doe (asdf) "                       │
│ 2048-bit RSA key, ID EB7B49EAD38DE665,                         │         
│ created 2018-10-09.                                            │         
│                                                                │         
│                                                                │         
│ Passphrase: _ │
│                                                                │         
│                                                    │
└─┘

一个快速的ps aux显示gpg-agent正在运行:

代码语言:javascript
复制
ps aux | grep gpg-agent
jdoe   14089  0.1  0.1 100884  3588 ?        SLs  18:50   0:07 /usr/bin/gpg-agent --supervised

唉,再次运行gpg2 --export-secret-keys...将提示我再次输入密码。

还有几个细节:

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2018-10-10 06:50:45

来自GnuPG 2.2.4手册,关于--export-secret-keys (特别是):

GnuPG可能要求您输入密码作为密钥。这是必需的,因为秘密密钥的内部保护方法不同于OpenPGP协议指定的方法。

票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/474385

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档