initializing/unlocking key explicitely with gpg-agent

Michael Richardson mcr at sandelman.ca
Fri Jun 6 15:16:08 CEST 2025


Ingo Klöcker <kloecker at kde.org> wrote:
    > Unless I'm missing something the PRESET_PASSPHRASE command is what you
    > are looking for:

    > $ gpg-connect-agent "help PRESET_PASSPHRASE" /bye # PRESET_PASSPHRASE
    > [--inquire] [--restricted] \ # <string_or_keygrip> <timeout>
    > [<hexstring>]
    > #
    > # Set the cached passphrase/PIN for the key identified by the keygrip #
    > to passwd for the given time, where -1 means infinite and 0 means # the
    > default (currently only a timeout of -1 is allowed, which means # to
    > never expire it).  If passwd is not provided, ask for it via the #
    > pinentry module unless --inquire is passed in which case the passphrase
    > # is retrieved from the client via a server inquire.  The option #
    > --restricted can be used to put the passphrase into the cache used # by
    > restricted connections.

"if passwd is not provided", but I don't see "passwd" as argument to
PRESET_PASSPHRASE.  Is it the hexstring?
I clearly don't want to use the pinentry, since it will do the gtk2 thing,
which I can't interact with remotely.

I happen to already have "allow-preset-passphrase" in gpg-agent.conf, which
suggests I have been down this path before, and forgot.

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        |    IoT architect   [
]     mcr at sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [





More information about the Gnupg-users mailing list