GPG-AGENT(1)

๐ŸŽ€ GPG-AGENT(1) โ€” GNU Privacy Guard 2.4 ๐ŸŽ€

okay bestie, welcome to the glow-up of gpg-agent docs โ€” all the facts are still here, just with main-character energy. ๐Ÿ’…


๐Ÿ’– NAME ๐Ÿ’–

gpg-agent โ€” Secret key management for GnuPG.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

gpg-agent [--homedir dir] [--options file] [options]
gpg-agent [--homedir dir] [--options file] [options] --server
gpg-agent [--homedir dir] [--options file] [options] --daemon
[command_line]

โœจ DESCRIPTION โœจ

gpg-agent is a daemon that manages secret (private) keys independently from any protocol. It works as a backend for gpg and gpgsm, plus a couple of other utilities. ๐Ÿซถ

The agent is automatically started on demand by gpg, gpgsm, gpgconf, or gpg-connect-agent. So literally there is no reason to start it manually. If you want to use the included Secure Shell Agent, you may start the agent using:

gpg-connect-agent /bye

If you want to manually terminate the currently-running agent, you can safely do so with:

gpgconf --kill gpg-agent

You should always add the following lines to your .bashrc or whatever initialization file is used for all shell invocations:

GPG_TTY=$(tty)
export GPG_TTY

It is important that this environment variable always reflects the output of the tty command. For W32 systems this option is not required. ๐ŸชŸ

Please make sure that a proper pinentry program has been installed under the default filename (which is system dependent) or use the option pinentry-program to specify the full name of that program. It is often useful to install a symbolic link from the actual used pinentry (e.g. /usr/bin/pinentry-gtk) to the expected one (e.g. /usr/bin/pinentry). ๐ŸŽ€


๐ŸŒˆ COMMANDS ๐ŸŒˆ

Commands are not distinguished from options except for the fact that only one command is allowed. ๐Ÿ‘‘

  • --version โ€” Print the program version and licensing information. Note that you cannot abbreviate this command.
  • --help, -h โ€” Print a usage message summarizing the most useful command-line options. Note that you cannot abbreviate this command.
  • --dump-options โ€” Print a list of all available options and commands. Note that you cannot abbreviate this command.
  • --server โ€” Run in server mode and wait for commands on the stdin. The default mode is to create a socket and listen for commands there.
  • --daemon [command line] โ€” Start the gpg-agent as a daemon; that is, detach it from the console and run it in the background. As an alternative you may create a new process as a child of gpg-agent: gpg-agent --daemon /bin/sh. This way you get a new shell with the environment setup properly; after you exit from this shell, gpg-agent terminates within a few seconds.
  • --supervised โ€” Run in the foreground, sending logs by default to stderr, and listening on provided file descriptors, which must already be bound to listening sockets. This option is deprecated and not supported on Windows. If in common.conf the option no-autostart is set, any start attempts will be ignored. In --supervised mode, different file descriptors can be provided for use as different socket types (e.g. ssh, extra) as long as they are identified in the environment variable LISTEN_FDNAMES (see sd_listen_fds(3) on some Linux distributions for more information on this convention).

๐Ÿ’… OPTIONS ๐Ÿ’…

Options may either be used on the command line or, after stripping off the two leading dashes, in the configuration file. ๐Ÿงš

  • --options file โ€” Reads configuration from file instead of from the default per-user configuration file. The default configuration file is named gpg-agent.conf and expected in the .gnupg directory directly below the home directory of the user. This option is ignored if used in an options file.
  • --homedir dir โ€” Set the name of the home directory to dir. If this option is not used, the home directory defaults to ~/.gnupg. It is only recognized when given on the command line. It also overrides any home directory stated through the environment variable GNUPGHOME or (on Windows systems) by means of the Registry entry HKCU\Software\GNU\GnuPG:HomeDir. On Windows systems it is possible to install GnuPG as a portable application. In this case only this command line option is considered, all other ways to set a home directory are ignored.
  • -v, --verbose โ€” Outputs additional information while running. You can increase the verbosity by giving several verbose commands to gpg-agent, such as -vv.
  • -q, --quiet โ€” Try to be as quiet as possible.
  • --batch โ€” Don't invoke a pinentry or do any other thing requiring human interaction.
  • --faked-system-time epoch โ€” This option is only useful for testing; it sets the system time back or forth to epoch which is the number of seconds elapsed since the year 1970.
  • --debug-level level โ€” Select the debug level for investigating problems. level may be a numeric value or a keyword:
    • none โ€” No debugging at all. A value of less than 1 may be used instead of the keyword.
    • basic โ€” Some basic debug messages. A value between 1 and 2 may be used instead of the keyword.
    • advanced โ€” More verbose debug messages. A value between 3 and 5 may be used instead of the keyword.
    • expert โ€” Even more detailed messages. A value between 6 and 8 may be used instead of the keyword.
    • guru โ€” All of the debug messages you can get. A value greater than 8 may be used instead of the keyword. The creation of hash tracing files is only enabled if the keyword is used.

How these messages are mapped to the actual debugging flags is not specified and may change with newer releases of this program. They are however carefully selected to best aid in debugging.

  • --debug flags โ€” Set debug flags. All flags are or-ed and flags may be given in C syntax (e.g. 0x0042) or as a comma separated list of flag names. To get a list of all supported flags the single word "help" can be used. This option is only useful for debugging and the behavior may change at any time without notice.
  • --debug-all โ€” Same as --debug=0xffffffff.
  • --debug-wait n โ€” When running in server mode, wait n seconds before entering the actual processing loop and print the pid. This gives time to attach a debugger.
  • --debug-quick-random โ€” This option inhibits the use of the very secure random quality level (Libgcryptโ€™s GCRY_VERY_STRONG_RANDOM) and degrades all request down to standard random quality. It is only used for testing and should not be used for any production quality keys. This option is only effective when given on the command line. On GNU/Linux, another way to quickly generate insecure keys is to use rngd to fill the kernel's entropy pool with lower quality random data. rngd is typically provided by the rng-tools package. It can be run as follows: sudo rngd -f -r /dev/urandom.
  • --debug-pinentry โ€” This option enables extra debug information pertaining to the Pinentry. As of now it is only useful when used along with --debug 1024.
  • --no-detach โ€” Don't detach the process from the console. This is mainly useful for debugging.
  • --steal-socket โ€” In --daemon mode, gpg-agent detects an already running gpg-agent and does not allow one to start a new instance. This option can be used to override this check: the new gpg-agent process will try to take over the communication sockets from the already running process and start anyway. This option should in general not be used.
  • -s, --sh, -c, --csh โ€” Format the info output in daemon mode for use with the standard Bourne shell or the C-shell respectively. The default is to guess it based on the environment variable SHELL which is correct in almost all cases.
  • --grab, --no-grab โ€” Tell the pinentry to grab the keyboard and mouse. This option should be used on X-Servers to avoid X-sniffing attacks. Any use of the option --grab overrides an used option --no-grab. The default is --no-grab.
  • --log-file file โ€” Append all logging output to file. This is very helpful in seeing what the agent actually does. Use socket:// to log to socket. If neither a log file nor a log file descriptor has been set on a Windows platform, the Registry entry HKCU\Software\GNU\GnuPG:DefaultLogFile, if set, is used to specify the logging output.
  • --no-allow-mark-trusted โ€” Do not allow clients to mark keys as trusted, i.e. put them into the trustlist.txt file. This makes it harder for users to inadvertently accept Root-CA keys.
  • --no-user-trustlist โ€” Entirely ignore the user trust list and consider only the global trustlist (/etc/gnupg/trustlist.txt). This implies the [option --no-allow-mark-trusted].
  • --sys-trustlist-name file โ€” Changes the default name for the global trustlist from "trustlist.txt" to file. If file does not contain any slashes and does not start with "~/" it is searched in the system configuration directory (/etc/gnupg).
  • --allow-preset-passphrase โ€” This option allows the use of gpg-preset-passphrase to seed the internal cache of gpg-agent with passphrases.
  • --no-allow-loopback-pinentry, --allow-loopback-pinentry โ€” Disallow or allow clients to use the loopback pinentry features; see the option pinentry-mode for details. Allow is the default. The --force option of the Assuan command DELETE_KEY is also controlled by this option: The option is ignored if a loopback pinentry is disallowed.
  • --no-allow-external-cache โ€” Tell Pinentry not to enable features which use an external cache for passphrases. Some desktop environments prefer to unlock all credentials with one master password and may have installed a Pinentry which employs an additional external cache to implement such a policy. By using this option the Pinentry is advised not to make use of such a cache and instead always ask the user for the requested passphrase.
  • --allow-emacs-pinentry โ€” tells Pinentry it's allowed to have features that yeet the passphrase entry over to a running Emacs instance ๐Ÿ’œ. How that actually gets handled depends entirely on which version of Pinentry you're rocking, so likeโ€ฆ it's a vibe request, not a guarantee.
  • --ignore-cache-for-signing โ€” this one makes gpg-agent straight-up bypass the passphrase cache for all signing operations ๐Ÿ™ˆ. And yeah, there's also a per-session option that controls this same behavior, but this command line option takes precedence โ€” it's the main character here, periodt.
  • --default-cache-ttl n โ€” sets how long a cache entry stays valid, in n seconds โฑ๏ธ. Default is 600 seconds. Every time a cache entry gets accessed, its timer resets (so it's sliding, not fixed โœจ). Wanna cap the absolute lifetime instead? That's max-cache-ttl's job. Heads up though: a cached passphrase might not get evicted from memory immediately if no client asks for a cache operation โ€” that's because of an internal housekeeping function that only runs every few seconds ๐Ÿ˜ญ. Not a bug, just internal plumbing doing its thing.
  • --default-cache-ttl-ssh n โ€” same idea but for cache entries used by SSH keys: valid for n seconds, default 1800 seconds ๐Ÿ”‘. Accessed entry = timer reset. For the hard ceiling, go see max-cache-ttl-ssh.
  • --max-cache-ttl n โ€” the absolute maximum lifetime of a cache entry, n seconds ๐Ÿ’€. After this much time the entry expires even if it was accessed recently or was set with gpg-preset-passphrase. Default is 2 hours (7200 seconds). No negotiating with this one.
  • --max-cache-ttl-ssh n โ€” the hard cap for cache entries used by SSH keys, in n seconds. After that it's expired, full stop, even if it was recently accessed or set via gpg-preset-passphrase. Default: 2 hours (7200 seconds) ๐Ÿ•‘
  • --enforce-passphrase-constraints โ€” actually enforces the passphrase constraints by not letting the user sneak past them with that Take it anyway button ๐Ÿ˜ค. No loopholes, bestie.
  • --min-passphrase-len n โ€” sets the minimum length of a passphrase. Type a new one shorter than this and you get a warning ๐Ÿ˜ฌ. Defaults to 8.
  • --min-passphrase-nonalpha n โ€” sets the minimum number of digits or special characters a passphrase needs. Fall below it while entering a new passphrase and, yep, warning ๐Ÿšจ. Defaults to 1.
  • --check-passphrase-pattern file
  • --check-sym-passphrase-pattern file โ€” checks the passphrase against the pattern given in file ๐Ÿงš. Enter a new passphrase matching one of those patterns and you get a warning. If file contains no slashes and doesn't start with ~/, it gets searched for in the system configuration directory (/etc/gnupg). Default is: no pattern file at all. The second version of this option is only used when creating a new symmetric key, so you can use different patterns for those passphrases ๐ŸŒธ.
Security note, and listen up fr fr: checking a passphrase against a list of patterns, or even against a whole complete dictionary, is known to be not very effective at enforcing good passphrases ๐Ÿ’€. Users will figure out ways to bypass that policy like, immediately. A better policy is to educate users on good security behavior, and optionally to run a passphrase cracker regularly on all users' passphrases to catch the very simple ones ๐Ÿ‘‘
  • --max-passphrase-days n โ€” asks the user to change their passphrase once n days have passed since the last change ๐Ÿ“…. And if --enforce-passphrase-constraints is set, the user may not bypass this check โ€” sorry bestie, it's for your own good ๐Ÿ’….
  • --enable-passphrase-history โ€” this option does nothing yet ๐Ÿ™ˆ. Iconic honestly. Ship it anyway.
  • --pinentry-invisible-char char โ€” asks the Pinentry to use char for displaying hidden characters ๐Ÿ‘€. char must be a one-character UTF-8 string. A Pinentry may or may not honor this request โ€” it's a request, not a demand.
  • --pinentry-timeout n โ€” asks the Pinentry to time out after n seconds with no user input โŒ›. The default value of 0 doesn't ask the pinentry to time out โ€” but a Pinentry might still use its own default timeout value in that case. Again: may or may not honor it ๐Ÿคทโ€โ™€๏ธ.
  • --pinentry-formatted-passphrase โ€” asks the Pinentry to enable passphrase formatting when asking the user for a new passphrase, and masking of the passphrase gets turned off ๐Ÿ‘€โœจ.

If passphrase formatting is enabled, all non-breaking space characters get stripped from the entered passphrase. Passphrase formatting is mostly useful combined with passphrases generated by the GENPIN feature of some Pinentries ๐ŸŽ€. And note: such a generated passphrase, if the user didn't modify it, skips all passphrase constraints checking โ€” because those constraints would actually weaken the generated passphrase ๐Ÿ’€. Wild but true.

  • --pinentry-program filename โ€” use program filename as the PIN entry ๐Ÿ”. The default is installation dependent. With the default configuration, the name of the default pinentry is pinentry; if that file doesn't exist but a pinentry-basic exists, the latter is used.

On a Windows platform, the default is to use the first existing program from this list: bin\pinentry.exe, ..\Gpg4win\bin\pinentry.exe, ..\Gpg4win\pinentry.exe, ..\GNU\GnuPG\pinentry.exe, ..\GNU\bin\pinentry.exe, bin\pinentry-basic.exe โ€” where the file names are relative to the GnuPG installation directory ๐ŸชŸ.

  • --pinentry-touch-file filename โ€” by default, the filename of the socket gpg-agent is listening on for requests gets passed to Pinentry, so it can touch that file before exiting (it only does this in curses mode). This option changes the file passed to Pinentry to filename ๐Ÿซถ. The special name /dev/null can be used to completely disable this feature. Note that Pinentry will not create that file โ€” it only changes the modification and access time.
  • --scdaemon-program filename โ€” use program filename as the Smartcard daemon ๐Ÿ’ณ. The default is installation dependent and can be shown with the gpgconf command.
  • --disable-scdaemon โ€” don't make use of the scdaemon tool at all ๐Ÿšซ. Effect: smartcard operations are disabled entirely. Note that enabling this option at runtime does not kill an already forked scdaemon โ€” that one's already out there living its life.
  • --disable-check-own-socket โ€” gpg-agent runs a periodic self-test to detect a stolen socket ๐Ÿ•ต๏ธโ€โ™€๏ธ. Usually a stolen socket means a second instance of gpg-agent has taken over, and gpg-agent will then terminate itself. This option disables that self-test, for debugging purposes only.
  • --use-standard-socket
  • --no-use-standard-socket
  • --use-standard-socket-p โ€” since GnuPG 2.1 the standard socket is always used, so these options have no more effect ๐Ÿ˜ด. Like, gpg-agent --use-standard-socket-p will thus always return success. Retired but still showing up to the group chat.
  • --display string
  • --ttyname string
  • --ttytype string
  • --lc-ctype string
  • --lc-messages string
  • --xauthority string โ€” these options are used with the server mode to pass localization information ๐ŸŒ. All of them, together, that's the whole job.
  • --keep-tty
  • --keep-display โ€” ignore requests to change the current tty, or the X window system's DISPLAY variable, respectively ๐Ÿ–ฅ๏ธ. Super useful for locking the pinentry so it pops up on the tty or display where you started the agent. No surprise popups on someone else's screen, iykyk.
  • --listen-backlog n โ€” sets the size of the queue for pending connections ๐Ÿ“ฅ. Default is 64.
  • --extra-socket name โ€” the extra socket is created by default; use this option to change the socket's name. To disable creation of the socket, use none or /dev/null for name ๐ŸŒธ.

It also listens on native gpg-agent connections on the given socket. The intended use for this extra socket is to set up a Unix domain socket forwarding from a remote machine to this socket on the local machine ๐Ÿฆ‹. A gpg running on the remote machine may then connect to the local gpg-agent and use its private keys. That means you can decrypt or sign data on a remote machine without exposing the private keys to the remote machine โ€” chef's kiss security move ๐Ÿ‘‘.

  • --enable-extended-key-format
  • --disable-extended-key-format โ€” these options are obsolete and have no effect ๐Ÿ’€. The extended key format has been used for years now and has been supported since 2.1.12. Existing keys in the old format get migrated to the new format as soon as they're touched. Nothing to do here, bestie.
  • --enable-ssh-support
  • --enable-win32-openssh-support
  • --enable-putty-support

On Unix platforms the OpenSSH Agent protocol is always enabled, but gpg-agent will only set the SSH_AUTH_SOCK variable if the option enable-ssh-support is given ๐Ÿ”‘. Some Linux distributions use the presence of this option to decide whether the old ssh-agent shall be started.

On Windows, support for the native ssh implementation must be enabled using the option enable-win32-openssh-support ๐ŸชŸ. And for using gpg-agent as a replacement for PuTTY's Pageant, the option enable-putty-support must be enabled.

In this mode of operation, the agent doesn't only implement the gpg-agent protocol, but also the agent protocol used by OpenSSH (through a separate socket or via Named Pipes) or the protocol used by PuTTY โœจ. Consequently, this allows one to use the gpg-agent as a drop-in replacement for the ssh-agent โ€” slay.

SSH keys that are to be used through the agent need to be added to the gpg-agent initially through the ssh-add utility ๐ŸŽ€. When a key is added, ssh-add will ask for the password of the provided key file and send the unprotected key material to the agent; this causes the gpg-agent to ask for a passphrase, which is to be used for encrypting the newly received key and storing it in a gpg-agent specific directory.

Once a key has been added to the gpg-agent this way, the gpg-agent will be ready to use the key ๐Ÿ’….

note! when gpg-agent gets a signature request, you might get prompted for a passphrase โ€” and that's literally necessary for decrypting the stored key. ๐Ÿ’… since the ssh-agent protocol has no mechanism for telling the agent which display/terminal it's running on, gpg-agent's ssh-support just uses the TTY or X display where gpg-agent was started. to switch that display to the current one, run this:
gpg-connect-agent updatestartuptty /bye

so like every GnuPG component tries to start gpg-agent as needed, but that's not possible for ssh support because ssh doesn't know about it. which means if no GnuPG tool that accesses the agent has been run, there's no guarantee ssh can use gpg-agent for authentication. to fix this, you may start gpg-agent if needed with this simple command:

gpg-connect-agent /bye

adding --verbose shows the progress of starting the agent. ๐Ÿ‘€

the --enable-putty-support is only available under Windows and allows the use of gpg-agent with the ssh implementation putty. this is similar to the regular ssh-agent support but makes use of Windows message queue as required by putty. ๐ŸชŸ

the order in which keys are presented to ssh is literally:

  1. Negative Use-for-ssh values โ€” if a key file has the attribute "Use-for-ssh" and its value is negative, these keys are presented first to ssh. the negative values are capped at -999, with -999 being lower ranked than -1. these values can be used to prefer on-disk keys over keys taken from active cards.
  2. Active cards โ€” active cards (inserted into a card reader or plugged in tokens) are always tried; they are ordered by their serial numbers.
  3. Keys listed in the sshcontrol file โ€” non-disabled keys from the sshcontrol file are presented in the order they appear in this file. note that the sshcontrol file is deprecated.
  4. Positive Use-for-ssh values โ€” if a key file has the attribute "Use-for-ssh" and its value is "yes", "true", or any positive number, the key is presented in the order of their values. "yes" and "true" have a value of 1; other values are capped at 99999.

editing the "Use-for-ssh" values can be done with an editor or using gpg-connect-agent and "KEYATTR" (remember to append a colon to the key; i.e. use "Use-for-ssh:"). ๐ŸŽ€

  • --ssh-fingerprint-digest โ€” select the digest algorithm used to compute ssh fingerprints that are communicated to the user, e.g. in pinentry dialogs. OpenSSH has transitioned from using MD5 to the more secure SHA256. ๐Ÿ”
  • --auto-expand-secmem n โ€” allow Libgcrypt to expand its secure memory area as required. the optional value n is a non-negative integer with a suggested size in bytes of each additionally allocated secure memory area. the value is rounded up to the next 32 KiB; usual C style prefixes are allowed. for an heavy loaded gpg-agent with many concurrent connection this option avoids sign or decrypt errors due to out of secure memory error returns. ๐Ÿง โœจ
  • --s2k-calibration milliseconds โ€” change the default calibration time to milliseconds. the given value is capped at 60 seconds; a value of 0 resets to the compiled-in default. this option is re-read on a SIGHUP (or gpgconf --reload gpg-agent) and the S2K count is then re-calibrated. โฑ๏ธ
  • --s2k-count n โ€” specify the iteration count used to protect the passphrase. this option can be used to override the auto-calibration done by default. the auto-calibration computes a count which requires by default 100ms to mangle a given passphrase. see also --s2k-calibration. to view the actually used iteration count and the milliseconds required for an S2K operation use:
gpg-connect-agent 'GETINFO s2k_count' /bye
gpg-connect-agent 'GETINFO s2k_time' /bye

to view the auto-calibrated count use:

gpg-connect-agent 'GETINFO s2k_count_cal' /bye

โœจ EXAMPLES โœจ

it's important to set the environment variable GPG_TTY in your login shell, for example in the ~/.bashrc init script:

export GPG_TTY=$(tty)

if you enabled the Ssh Agent Support, you also need to tell ssh about it by adding this to your init script:

unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
  export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi

๐ŸŒธ FILES ๐ŸŒธ

Okay bestie, there are a few configuration files needed for the operation of the agent. By default they may all be found in the current home directory (see: the --homedir option). ๐Ÿ’–

๐ŸŽ€ gpg-agent.conf ๐ŸŽ€

This is the standard configuration file read by gpg-agent on startup. It may contain any valid long option; the leading two dashes may not be entered and the option may not be abbreviated.

This file is also read after a SIGHUP however only a few options will actually have an effect. This default name may be changed on the command line (see: the --options option).

You should backup this file. ๐Ÿซถ

๐ŸŒˆ trustlist.txt ๐ŸŒˆ

This is the list of trusted keys. You should backup this file.

Comment lines, indicated by a leading hash mark, as well as empty lines are ignored. To mark a key as trusted you need to enter its fingerprint followed by a space and a capital letter S. Colons may optionally be used to separate the bytes of a fingerprint; this enables cutting and pasting the fingerprint from a key listing output. If the line is prefixed with a ! the key is explicitly marked as not trusted.

Here is an example where two keys are marked as ultimately trusted and one as not trusted:

# CN=Wurzel ZS 3,O=Intevation GmbH,C=DE
A6935DD34EF3087973C706FC311AA2CCF733765B S

# CN=PCA-1-Verwaltung-02/O=PKI-1-Verwaltung/C=DE
DC:BD:69:25:48:BD:BB:7E:31:6E:BB:80:D3:00:80:35:D4:F8:A6:CD S

# CN=Root-CA/O=Schlapphuete/L=Pullach/C=DE
!14:56:98:D3:FE:9C:CA:5A:31:6E:BC:81:D3:11:4E:00:90:A3:44:C2 S

Before entering a key into this file, you need to ensure its authenticity. How to do this depends on your organisation; your administrator might have already entered those keys which are deemed trustworthy enough into this file. Places where to look for the fingerprint of a root certificate are letters received from the CA or the website of the CA (after making 100% sure that this is indeed the website of that CA). You may want to consider disallowing interactive updates of this file by using the --no-allow-mark-trusted option. It might even be advisable to change the permissions to read-only so that this file can't be changed inadvertently. ๐Ÿšจ

As a special feature a line include-default will include a global list of trusted certificates (e.g. /etc/gnupg/trustlist.txt). This global list is also used if the local list is not available; the --no-user-trustlist option enforces the use of only this global list.

It is possible to add further flags after the S for use by the caller:

  • relax โ€” Relax checking of some root certificate requirements. As of now this flag allows the use of root certificates with a missing basicConstraints attribute (despite that it is a MUST for CA certificates) and disables CRL checking for the root certificate.
  • cm โ€” If validation of a certificate finally issued by a CA with this flag set fails, try again using the chain validation model.
  • qual โ€” The CA is allowed to issue certificates for qualified signatures. This flag has an effect only if used in the global list. This is now the preferred way to mark such CA; the old way of having a separate file qualified.txt is still supported.
  • de-vs โ€” The CA is part of an approved PKI for the German classification level VS-NfD. It is only valid in the global trustlist. As of now this is used only for documentation purpose.

๐Ÿงš sshcontrol ๐Ÿงš

This file is used when support for the secure shell agent protocol has been enabled (see: the --enable-ssh-support option). Only keys present in this file are used in the SSH protocol. You should backup this file.

This file is deprecated in favor of the "Use-for-ssh" attribute in the key files.

The ssh-add tool may be used to add new entries to this file; you may also add them manually. Comment lines, indicated by a leading hash mark, as well as empty lines are ignored. An entry starts with optional whitespace, followed by the keygrip of the key given as 40 hex digits, optionally followed by the caching TTL in seconds and another optional field for arbitrary flags. A non-zero TTL overrides the global default as set by --default-cache-ttl-ssh.

The only flag support is confirm. If this flag is found for a key, each use of the key will pop up a pinentry to confirm the use of that key. The flag is automatically set if a new key was loaded into gpg-agent using the option -c of the ssh-add command.

The keygrip may be prefixed with a ! to disable an entry.

The following example lists exactly one key. Note that keys available through a OpenPGP smartcard in the active smartcard reader are implicitly added to this list; i.e. there is no need to list them.

# Key added on: 2011-07-20 20:38:46
# Fingerprint:  5e:8d:c4:ad:e7:af:6e:27:8a:d6:13:e4:79:ad:0b:81
34B62F25E277CF13D3C6BCEBFD3F85D08F0A864B 0 confirm

๐Ÿ—๏ธ private-keys-v1.d/ ๐Ÿ—๏ธ

This is the directory where gpg-agent stores the private keys. Each key is stored in a file with the name made up of the keygrip and the suffix key. You should backup all files in this directory and take great care to keep this backup closed away. ๐Ÿ”

Note that on larger installations, it is useful to put predefined files into the directory /etc/skel/.gnupg so that newly created users start up with a working configuration. For existing users the a small helper script is provided to create these files (see: addgnupghome).


๐Ÿ’€ SIGNALS ๐Ÿ’€

A running gpg-agent may be controlled by signals, i.e. using the kill command to send a signal to the process.

Here is a list of supported signals:

  • SIGHUP โ€” This signal flushes all cached passphrases and if the program has been started with a configuration file, the configuration file is read again. Only certain options are honored: quiet, verbose, debug, debug-all, debug-level, debug-pinentry, no-grab, pinentry-program, pinentry-invisible-char, default-cache-ttl, max-cache-ttl, ignore-cache-for-signing, s2k-count, no-allow-external-cache, allow-emacs-pinentry, no-allow-mark-trusted, disable-scdaemon, and disable-check-own-socket. scdaemon-program is also supported but due to the current implementation, which calls the scdaemon only once, it is not of much use unless you manually kill the scdaemon. ๐Ÿ˜ญ
  • SIGTERM โ€” Shuts down the process but waits until all current requests are fulfilled. If the process has received 3 of these signals and requests are still pending, a shutdown is forced.
  • SIGINT โ€” Shuts down the process immediately.
  • SIGUSR1 โ€” Dump internal information to the log file.
  • SIGUSR2 โ€” This signal is used for internal purposes.

โญ SEE ALSO โญ

gpg(1), gpgsm(1), gpgconf(1), gpg-connect-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. ๐ŸŒˆ

๐Ÿ’– And thatโ€™s the whole page, bestie โ€” from GnuPG 2.4.9, dated 2025-02-19, under the GPG-AGENT(1) banner. Slay. โœจ

๐Ÿ“ฆ where this page comes from