GPG-PRESET-PASSPHRASE(1)

πŸ’… GPG-PRESET-PASSPHRASE πŸ’…

okay so bestie, welcome to the gpg-preset-passphrase page β€” part of the GNU Privacy Guard 2.4 fam. buckle up πŸŽ€


✨ NAME ✨

gpg-preset-passphrase β€” put a passphrase into gpg-agent's cache 🧚


🌸 SYNOPSIS 🌸

gpg-preset-passphrase [options] [command] cache-id

πŸ¦‹ DESCRIPTION πŸ¦‹

so gpg-preset-passphrase is literally this little utility that seeds the internal cache of a running gpg-agent with passphrases. that's the whole gig. πŸ’–

it's mainly useful for unattended machines, like where the usual pinentry tool may not be used and the passphrases for the keys you're gonna use are given at machine startup. no humans, just vibes ✨

this program works with GnuPG 2 and later. GnuPG 1.x is not supported β€” she does not know her, she does not see her 🫢

ngl the passphrases you set with this utility don't expire unless the --forget option is used to explicitly clear them from the cache β€” or gpg-agent is either restarted or reloaded (by sending a SIGHUP to it). rude but okay πŸ’€

heads up bestie: the maximum cache time as set with --max-cache-ttl is still honored. and you gotta allow this passphrase presetting by starting gpg-agent with the --allow-preset-passphrase. no permission, no preset, periodt πŸ‘‘

gpg-preset-passphrase is invoked this way:

gpg-preset-passphrase [options] [command] cacheid

so cacheid is either a 40 character keygrip of hexadecimal characters identifying the key for which the passphrase should be set or cleared. that's a lot of hex, but she's worth it 🌈

the keygrip is listed along with the key when running this command:

gpgsm --with-keygrip --list-secret-keys

alternatively, an arbitrary string may be used to identify a passphrase β€” it is suggested that such a string is prefixed with the name of the application (e.g. foo:12346). main character naming energy fr fr πŸ’…

scripts should always use the option --with-colons, which provides the keygrip in a "grp" line (cf. doc/DETAILS).


πŸ‘‘ COMMANDS β€” you must pick one, no skipping πŸ‘‘

one of the following command options must be given:

  • --preset β€” preset a passphrase. this is what you usually will use, lowkey the default bestie. gpg-preset-passphrase will then read the passphrase from stdin. πŸ“
  • --forget β€” flush the passphrase for the given cache ID from the cache. she's gone, she's deleted, no cap πŸ¦‹

πŸ’œ OPTIONS β€” the bonus round πŸ’œ

the following additional options may be used:

  • -v, --verbose β€” output additional information while running. she's chatty and we love that πŸ—£οΈβœ¨
  • -P string, --passphrase string β€” instead of reading the passphrase from stdin, use the supplied string as passphrase.
⚠️ bestie READ THIS: note that this makes the passphrase visible for other users. like actually visible. on the machine. to other people. if that's not the vibe, pipe it through stdin instead πŸ˜­πŸ™ˆ

🌟 SEE ALSO 🌟

gpg(1), gpgsm(1), gpg-agent(1), scdaemon(1)

the full documentation for this tool is maintained as a Texinfo manual. if GnuPG and the info program are properly installed at your site, the command

info gnupg

should give you access to the complete manual including a menu structure and an index. iconique πŸ’…


that's the whole page bestie, go preset some passphrases responsibly 🫢 this was GnuPG 2.4.9, dated 2025-02-19 β€” catch you on the next manpage, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from