4

Issue: - The passphrase is repeatedly being requested when I pass show <name of credential>.

Doing some Googling, I found you can do that with gpg-preset-passphrase, however I'm not sure where to get it or if it included in the gpg distribution.

This is the current version of gpg I'm running.

Does anyone know how to get gpg-preset-passphrase installed?

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 

3 Answers 3

10

Looks like it was installed but just not directly accessible through the gpg-preset-passphrase command, but rather: /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. 
7

The most compatible way is to use gpgconf --list-dirs libexecdir like this:

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

I've tested this on both macOS and ubuntu 18.04, the folder is set to:

  • on macOS: /opt/homebrew/Cellar/gnupg/2.3.7_1/libexec
  • ubuntu: /usr/lib/gnupg

Remember: to use --preset you need to add allow-preset-passphrase to your .gnupg/gpg-agent.conf. It is useful as well to change the default 2h storage time to something larger, the agent config options are:

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

The values are expressed in seconds.

2

On my Ubuntu 16 install it was in the gnupg-agent package and placed in /usr/lib/gnupg2/gpg-preset-passphrase.

1
  • On ubuntu 18.04.5 it is gpg-agent under /usr/lib/gnupg/gpg-preset-passphrase Commented Jul 21, 2022 at 9:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.