gpg - gpg-预设密码安装

gpg - gpg-预设密码安装

问题: - 当我通过时,系统会重复要求输入密码show <name of credential>

做了一些谷歌搜索,我发现你可以使用 gpg-preset-passphrase 来做到这一点,但是我不确定从哪里获取它或者它是否包含在 gpg 发行版中。

这是我正在运行的 gpg 的当前版本。

有谁知道如何安装 gpg-preset-passphrase ?

gpg --version
gpg (GnuPG) 2.0.22
libgcrypt 1.5.3
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, ?, ?, ELG, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

答案1

看起来它已安装,但只是不能通过命令直接访问gpg-preset-passphrase,而是/usr/libexec/gpg-preset-passphrase::

/usr/libexec/gpg-preset-passphrase --version
gpg-preset-passphrase (GnuPG) 2.0.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

答案2

gpgconf --list-dirs libexecdir 最兼容的方式是这样使用:

"$(gpgconf --list-dirs libexecdir)"/gpg-preset-passphrase --present

我已经在 macOS 和 ubuntu 18.04 上对此进行了测试,文件夹设置为:

  • 在 macOS 上:/opt/homebrew/Cellar/gnupg/2.3.7_1/libexec
  • 乌班图: /usr/lib/gnupg

请记住使用预设,您需要将allow-preset-passphrase\ 添加到您的.gnupg/gpg-agent.conf.将默认的 2 小时存储时间更改为更大的值也很有用,代理配置选项为:

max-cache-ttl 34560000 
max-cache-ttl-ssh 34560000 

答案3

在我的 Ubuntu 16 安装中,它位于gnupg-agent软件包中并放置在/usr/lib/gnupg2/gpg-preset-passphrase.

相关内容