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
    • 最新
    • 标签
主页 / user-16960

Barton Chittenden's questions

Martin Hope
Barton Chittenden
Asked: 2018-10-10 16:26:22 +0800 CST

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

  • 2

当我运行 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 个回答
  • 1714 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

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

    • 4 个回答
  • Marko Smith

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

    • 5 个回答
  • Marko Smith

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

    • 3 个回答
  • 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
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +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

热门标签

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