在没有运行 gpg-agent 的情况下,我可以输入我的密码来签名:
$ echo 123 | gpg -s
You need a passphrase to unlock the secret key for
user: "Mr. Ops <ops@bxxx.com>"
2048-bit RSA key, ID 20F31903, created 2014-03-13
gpg: gpg-agent is not available in this session
Enter passphrase:
Run Code Online (Sandbox Code Playgroud)
工作正常。但我不想一直输入密码,所以我运行 gpg-agent:
$ eval $(gpg-agent --daemon)
Run Code Online (Sandbox Code Playgroud)
现在我希望至少有一次提示我输入密码,但我从来没有,并且所有使用 gpg 的操作都失败了。
$ echo 123 | gpg -s
You need a passphrase to unlock the secret key for
user: "Mr. Ops <ops@bxxxx.com>"
2048-bit RSA key, ID 20F31903, created 2014-03-13
gpg: cancelled by user
gpg: no default secret key: bad passphrase
gpg: signing failed: bad passphrase
Run Code Online (Sandbox Code Playgroud)
如何让我的密码存储在代理中?一旦我在那里,我如何在登录会话中保持它?(理想情况下,我永远不想再收到提示。)这是在 Ubuntu 12.04.4 上使用标准的 apt-get gpg 包,以防万一。
小智 21
当gpg-agent不知道提示哪个 TTY时会发生这种情况,这是因为您正在重定向标准输入。
你可以把export GPG_TTY=$(tty)你~/.bashrc设置的TTY每个登录shell。
上的文档gpg-agent有更多详细信息。
| 归档时间: |
|
| 查看次数: |
19519 次 |
| 最近记录: |