AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 474385
Accepted
Barton Chittenden
Barton Chittenden
Asked: 2018-10-10 16:26:22 +0800 CST2018-10-10 16:26:22 +0800 CST 2018-10-10 16:26:22 +0800 CST

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

  • 772

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

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 秒内再次运行它,我将不会再收到提示。跑步

gpg2 --export-secret-keys --armor [email protected] > /dev/null

给了我这个:

┌─┐
│ Please enter the passphrase to export the OpenPGP secret key:  │
│ "John Doe (asdf) <[email protected]>"                       │
│ 2048-bit RSA key, ID EB7B49EAD38DE665,                         │         
│ created 2018-10-09.                                            │         
│                                                                │         
│                                                                │         
│ Passphrase: _ │
│                                                                │         
│         <OK>                                    <Cancel>       │
└─┘

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

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...再次提示我输入密码。

更多细节:

  • 我在用着pinentry-curses
  • 我已经$GPG_TTY在我的.bashrc
  • gpg2 --version -> gpg (GnuPG) 2.2.4
  • 我已经通读了为什么即使使用 gpg-agent 也会要求 gpg 输入密码?以及如何找出 gpg-agent 缓存的密钥?(比如 ssh-add -l 如何显示缓存的 ssh 密钥),但我并没有完全理解。
gpg gpg-agent
  • 1 1 个回答
  • 1714 Views

1 个回答

  • Voted
  1. Best Answer
    Kusalananda
    2018-10-10T22:50:45+08:002018-10-10T22:50:45+08:00

    从 GnuPG 2.2.4 手册中,关于--export-secret-keys(特别):

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

    • 2

相关问题

  • 我在 Enigmail 中创建了一个加密密钥对,但是当我在终端中执行 `gpg --list-keys` 时看不到它

  • apt 密钥管理失败任何完整的在线解决方案或密钥下载方法

  • 如何恢复(或重置)*.debian.org 的 GPG 密钥?

  • 为什么有时需要手动导入密钥?

  • gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve