{
    "mode": "man",
    "parameter": "GPG-AGENT",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/GPG-AGENT/1/json",
    "generated": "2026-06-15T16:47:18Z",
    "synopsis": "gpg-agent [--homedir dir] [--options file] [options]\ngpg-agent [--homedir dir] [--options file] [options] --server\ngpg-agent [--homedir dir] [--options file] [options] --daemon [commandline]",
    "sections": {
        "NAME": {
            "content": "gpg-agent - Secret key management for GnuPG\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "gpg-agent [--homedir dir] [--options file] [options]\ngpg-agent [--homedir dir] [--options file] [options] --server\ngpg-agent [--homedir dir] [--options file] [options] --daemon [commandline]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "gpg-agent is a daemon to manage secret (private) keys independently from any protocol.  It is\nused as a backend for gpg and gpgsm as well as for a couple of other utilities.\n\nThe agent is automatically started on demand by gpg, gpgsm,  gpgconf,  or  gpg-connect-agent.\nThus  there  is  no reason to start it manually.  In case you want to use the included Secure\nShell Agent you may start the agent using:\n\n\ngpg-connect-agent /bye\n\n\nIf you want to manually terminate the currently-running agent, you can safely do so with:\n\ngpgconf --kill gpg-agent\n\n\nYou should always add the following lines to your .bashrc or whatever initialization file  is\nused for all shell invocations:\n\nGPGTTY=$(tty)\nexport GPGTTY\n\n\nIt is important that this environment variable always reflects the output of the tty command.\nFor W32 systems this option is not required.\n\nPlease make sure that a proper pinentry program has been installed under the default filename\n(which  is  system  dependent) or use the option pinentry-program to specify the full name of\nthat program.  It is often useful to install a symbolic link from the  actual  used  pinentry\n(e.g. ‘/usr/bin/pinentry-gtk’) to the expected one (e.g. ‘/usr/bin/pinentry’).\n\n\n\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "Commands  are not distinguished from options except for the fact that only one command is al‐\nlowed.\n\n",
            "subsections": [
                {
                    "name": "--version",
                    "content": "Print the program version and licensing information.  Note that you cannot  abbreviate\nthis command.\n\n",
                    "long": "--version"
                },
                {
                    "name": "--help",
                    "content": "",
                    "long": "--help"
                },
                {
                    "name": "-h",
                    "content": "cannot abbreviate this command.\n\n",
                    "flag": "-h"
                },
                {
                    "name": "--dump-options",
                    "content": "Print a list of all available options and commands.  Note that you  cannot  abbreviate\nthis command.\n\n",
                    "long": "--dump-options"
                },
                {
                    "name": "--server",
                    "content": "Run  in server mode and wait for commands on the stdin.  The default mode is to create\na socket and listen for commands there.\n\n\n--daemon [command line]\nStart the gpg-agent as a daemon; that is, detach it from the console and run it in the\nbackground.\n\nAs  an  alternative  you  may  create a new process as a child of gpg-agent: gpg-agent\n--daemon /bin/sh.  This way you get a new shell with the environment  setup  properly;\nafter you exit from this shell, gpg-agent terminates within a few seconds.\n\n",
                    "long": "--server"
                },
                {
                    "name": "--supervised",
                    "content": "Run  in  the  foreground, sending logs by default to stderr, and listening on provided\nfile descriptors, which must already be bound to listening sockets.  This  command  is\nuseful  when running under systemd or other similar process supervision schemes.  This\noption is not supported on Windows.\n\nIn --supervised mode, different file descriptors can be provided for use as  different\nsocket types (e.g. ssh, extra) as long as they are identified in the environment vari‐\nable LISTENFDNAMES (see sdlistenfds(3) on some Linux distributions for more  infor‐\nmation on this convention).\n",
                    "long": "--supervised"
                }
            ]
        },
        "OPTIONS": {
            "content": "Options  may  either  be  used  on  the  command line or, after stripping off the two leading\ndashes, in the configuration file.\n\n\n\n\n--options file\nReads configuration from file instead of from the default per-user configuration file.\nThe  default configuration file is named ‘gpg-agent.conf’ and expected in the ‘.gnupg’\ndirectory directly below the home directory of the user.  This option  is  ignored  if\nused in an options file.\n\n\n\n--homedir dir\nSet the name of the home directory to dir. If this option is not used, the home direc‐\ntory defaults to ‘~/.gnupg’.  It is only recognized when given on  the  command  line.\nIt  also  overrides  any  home  directory  stated  through  the  environment  variable\n‘GNUPGHOME’ or (on  Windows  systems)  by  means  of  the  Registry  entry  HKCU\\Soft‐\nware\\GNU\\GnuPG:HomeDir.\n\nOn Windows systems it is possible to install GnuPG as a portable application.  In this\ncase only this command line option is considered, all other ways to set a home  direc‐\ntory are ignored.\n\nTo  install  GnuPG as a portable application under Windows, create an empty file named\n‘gpgconf.ctl’ in the same directory as the tool ‘gpgconf.exe’.  The root  of  the  in‐\nstallation  is  then  that directory; or, if ‘gpgconf.exe’ has been installed directly\nbelow a directory named ‘bin’, its parent directory.  You also need to make sure  that\nthe  following  directories exist and are writable: ‘ROOT/home’ for the GnuPG home and\n‘ROOT/var/cache/gnupg’ for internal cache files.\n\n\n",
            "subsections": [
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "--verbose",
                    "content": "Outputs additional information while running.  You can increase the verbosity by  giv‐\ning several verbose commands to gpg-agent, such as ‘-vv’.\n\n",
                    "long": "--verbose"
                },
                {
                    "name": "-q",
                    "content": "",
                    "flag": "-q"
                },
                {
                    "name": "--quiet",
                    "content": "Try to be as quiet as possible.\n\n",
                    "long": "--quiet"
                },
                {
                    "name": "--batch",
                    "content": "Don't invoke a pinentry or do any other thing requiring human interaction.\n\n\n--faked-system-time epoch\nThis option is only useful for testing; it sets the system time back or forth to epoch\nwhich is the number of seconds elapsed since the year 1970.\n\n\n--debug-level level\nSelect the debug level for investigating problems. level may be a numeric value  or  a\nkeyword:\n\n\nnone   No  debugging  at  all.  A value of less than 1 may be used instead of the key‐\nword.\n\nbasic  Some basic debug messages.  A value between 1 and 2 may be used instead of  the\nkeyword.\n\nadvanced\nMore  verbose  debug  messages.  A value between 3 and 5 may be used instead of\nthe keyword.\n\nexpert Even more detailed messages.  A value between 6 and 8 may be  used  instead  of\nthe keyword.\n\nguru   All  of  the debug messages you can get. A value greater than 8 may be used in‐\nstead of the keyword.  The creation of hash tracing files is  only  enabled  if\nthe keyword is used.\n\nHow  these  messages are mapped to the actual debugging flags is not specified and may change\nwith newer releases of this program. They are however carefully selected to best aid  in  de‐\nbugging.\n\n\n--debug flags\nThis option is only useful for debugging and the behavior may change at any time with‐\nout notice.  FLAGS are bit encoded and may be given in usual C-Syntax.  The  currently\ndefined bits are:\n\n\n0 (1)  X.509 or OpenPGP protocol related data\n\n1 (2)  values of big number integers\n\n2 (4)  low level crypto operations\n\n5 (32) memory allocation\n\n6 (64) caching\n\n7 (128)\nshow memory statistics\n\n9 (512)\nwrite hashed data to files named dbgmd-000*\n\n10 (1024)\ntrace Assuan protocol\n\n12 (4096)\nbypass all certificate validation\n\n",
                    "long": "--batch"
                },
                {
                    "name": "--debug-all",
                    "content": "Same as --debug=0xffffffff\n\n\n--debug-wait n\nWhen running in server mode, wait n seconds before entering the actual processing loop\nand print the pid.  This gives time to attach a debugger.\n\n",
                    "long": "--debug-all"
                },
                {
                    "name": "--debug-quick-random",
                    "content": "This option inhibits the use of the very  secure  random  quality  level  (Libgcrypt’s\nGCRYVERYSTRONGRANDOM) and degrades all request down to standard random quality.  It\nis only used for testing and should not be used for any production quality keys.  This\noption is only effective when given on the command line.\n\nOn GNU/Linux, another way to quickly generate insecure keys is to use rngd to fill the\nkernel's entropy pool with lower quality random data.  rngd is typically  provided  by\nthe rng-tools package.  It can be run as follows: ‘sudo rngd -f -r /dev/urandom’.\n\n",
                    "long": "--debug-quick-random"
                },
                {
                    "name": "--debug-pinentry",
                    "content": "This  option enables extra debug information pertaining to the Pinentry.  As of now it\nis only useful when used along with --debug 1024.\n\n",
                    "long": "--debug-pinentry"
                },
                {
                    "name": "--no-detach",
                    "content": "Don't detach the process from the console.  This is mainly useful for debugging.\n\n",
                    "long": "--no-detach"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "--sh",
                    "content": "",
                    "long": "--sh"
                },
                {
                    "name": "-c",
                    "content": "--csh  Format the info output in daemon mode for use with the standard Bourne shell or the C-\nshell  respectively.   The  default  is  to guess it based on the environment variable\nSHELL which is correct in almost all cases.\n\n\n",
                    "flag": "-c"
                },
                {
                    "name": "--grab",
                    "content": "",
                    "long": "--grab"
                },
                {
                    "name": "--no-grab",
                    "content": "Tell the pinentry to grab the keyboard and mouse.  This option should be  used  on  X-\nServers  to  avoid  X-sniffing attacks. Any use of the option --grab overrides an used\noption --no-grab.  The default is --no-grab.\n\n\n\n--log-file file\nAppend all logging output to file.  This is very helpful in seeing what the agent  ac‐\ntually  does.  Use ‘socket://’ to log to socket.  If neither a log file nor a log file\ndescriptor has  been  set  on  a  Windows  platform,  the  Registry  entry  HKCU\\Soft‐‐\nware\\GNU\\GnuPG:DefaultLogFile, if set, is used to specify the logging output.\n\n\n\n",
                    "long": "--no-grab"
                },
                {
                    "name": "--no-allow-mark-trusted",
                    "content": "Do  not  allow clients to mark keys as trusted, i.e. put them into the ‘trustlist.txt’\nfile.  This makes it harder for users to inadvertently accept Root-CA keys.\n\n\n",
                    "long": "--no-allow-mark-trusted"
                },
                {
                    "name": "--allow-preset-passphrase",
                    "content": "This option allows the use of gpg-preset-passphrase to seed the internal cache of gpg-\nagent with passphrases.\n\n\n",
                    "long": "--allow-preset-passphrase"
                },
                {
                    "name": "--no-allow-loopback-pinentry",
                    "content": "",
                    "long": "--no-allow-loopback-pinentry"
                },
                {
                    "name": "--allow-loopback-pinentry",
                    "content": "Disallow or allow clients to use the loopback pinentry features; see the option pinen‐‐\ntry-mode for details.  Allow is the default.\n\nThe --force option of the Assuan command DELETEKEY is also controlled by this option:\nThe option is ignored if a loopback pinentry is disallowed.\n\n",
                    "long": "--allow-loopback-pinentry"
                },
                {
                    "name": "--no-allow-external-cache",
                    "content": "Tell Pinentry not to enable features which use an external cache for passphrases.\n\nSome  desktop  environments  prefer to unlock all credentials with one master password\nand may have installed a Pinentry which employs an additional external cache to imple‐\nment  such  a policy.  By using this option the Pinentry is advised not to make use of\nsuch a cache and instead always ask the user for the requested passphrase.\n\n",
                    "long": "--no-allow-external-cache"
                },
                {
                    "name": "--allow-emacs-pinentry",
                    "content": "Tell Pinentry to allow features to divert the passphrase entry to a running Emacs  in‐\nstance.  How this is exactly handled depends on the version of the used Pinentry.\n\n",
                    "long": "--allow-emacs-pinentry"
                },
                {
                    "name": "--ignore-cache-for-signing",
                    "content": "This  option will let gpg-agent bypass the passphrase cache for all signing operation.\nNote that there is also a per-session option to control this behavior but this command\nline option takes precedence.\n\n\n--default-cache-ttl n\nSet  the  time a cache entry is valid to n seconds.  The default is 600 seconds.  Each\ntime a cache entry is accessed, the entry's timer is reset.  To set an entry's maximum\nlifetime, use max-cache-ttl.  Note that a cached passphrase may not be evicted immedi‐\nately from memory if no client requests a cache operation.  This is due to an internal\nhousekeeping function which is only run every few seconds.\n\n\n--default-cache-ttl-ssh n\nSet  the  time  a cache entry used for SSH keys is valid to n seconds.  The default is\n1800 seconds.  Each time a cache entry is accessed, the entry's timer  is  reset.   To\nset an entry's maximum lifetime, use max-cache-ttl-ssh.\n\n\n--max-cache-ttl n\nSet the maximum time a cache entry is valid to n seconds.  After this time a cache en‐\ntry will be expired even if it has been accessed recently or has been set  using  gpg-\npreset-passphrase.  The default is 2 hours (7200 seconds).\n\n\n--max-cache-ttl-ssh n\nSet  the  maximum  time  a cache entry used for SSH keys is valid to n seconds.  After\nthis time a cache entry will be expired even if it has been accessed recently  or  has\nbeen set using gpg-preset-passphrase.  The default is 2 hours (7200 seconds).\n\n",
                    "long": "--ignore-cache-for-signing"
                },
                {
                    "name": "--enforce-passphrase-constraints",
                    "content": "Enforce  the  passphrase constraints by not allowing the user to bypass them using the\n``Take it anyway'' button.\n\n\n--min-passphrase-len n\nSet the minimal length of a passphrase.  When entering a new passphrase  shorter  than\nthis value a warning will be displayed.  Defaults to 8.\n\n\n--min-passphrase-nonalpha n\nSet the minimal number of digits or special characters required in a passphrase.  When\nentering a new passphrase with less than this number of digits or special characters a\nwarning will be displayed.  Defaults to 1.\n\n\n--check-passphrase-pattern file\nCheck  the  passphrase  against  the  pattern  given  in  file.   When  entering a new\npassphrase matching one of these pattern a warning will be displayed. file  should  be\nan absolute filename.  The default is not to use any pattern file.\n\nSecurity  note:  It  is  known that checking a passphrase against a list of pattern or\neven against a complete dictionary is not very effective to enforce good  passphrases.\nUsers will soon figure up ways to bypass such a policy.  A better policy is to educate\nusers on good security behavior and optionally to run a passphrase  cracker  regularly\non all users passphrases to catch the very simple ones.\n\n\n--max-passphrase-days n\nAsk  the  user  to  change the passphrase if n days have passed since the last change.\nWith --enforce-passphrase-constraints set the user may not bypass this check.\n\n",
                    "long": "--enforce-passphrase-constraints"
                },
                {
                    "name": "--enable-passphrase-history",
                    "content": "This option does nothing yet.\n\n\n--pinentry-invisible-char char\nThis option asks the Pinentry to use char for displaying hidden characters.  char must\nbe one character UTF-8 string.  A Pinentry may or may not honor this request.\n\n\n--pinentry-timeout n\nThis  option asks the Pinentry to timeout after n seconds with no user input.  The de‐\nfault value of 0 does not ask the pinentry to timeout, however a Pinentry may use  its\nown default timeout value in this case.  A Pinentry may or may not honor this request.\n\n\n--pinentry-program filename\nUse  program  filename as the PIN entry.  The default is installation dependent.  With\nthe default configuration the name of the default pinentry is ‘pinentry’; if that file\ndoes not exist but a ‘pinentry-basic’ exist the latter is used.\n\nOn a Windows platform the default is to use the first existing program from this list:\n‘bin\\pinentry.exe’,     ‘..\\Gpg4win\\bin\\pinentry.exe’,      ‘..\\Gpg4win\\pinentry.exe’,\n‘..\\GNU\\GnuPG\\pinentry.exe’, ‘..\\GNU\\bin\\pinentry.exe’, ‘bin\\pinentry-basic.exe’ where\nthe file names are relative to the GnuPG installation directory.\n\n\n\n--pinentry-touch-file filename\nBy default the filename of the socket gpg-agent is listening for requests is passed to\nPinentry,  so  that it can touch that file before exiting (it does this only in curses\nmode).  This option changes the file passed to Pinentry to filename.  The special name\n/dev/null may be used to completely disable this feature.  Note that Pinentry will not\ncreate that file, it will only change the modification and access time.\n\n\n\n--scdaemon-program filename\nUse program filename as the Smartcard daemon.  The default is  installation  dependent\nand can be shown with the gpgconf command.\n\n",
                    "long": "--enable-passphrase-history"
                },
                {
                    "name": "--disable-scdaemon",
                    "content": "Do  not  make  use  of the scdaemon tool.  This option has the effect of disabling the\nability to do smartcard operations.  Note, that enabling this option at  runtime  does\nnot kill an already forked scdaemon.\n\n",
                    "long": "--disable-scdaemon"
                },
                {
                    "name": "--disable-check-own-socket",
                    "content": "gpg-agent  employs a periodic self-test to detect a stolen socket.  This usually means\na second instance of gpg-agent has taken over the socket and gpg-agent will then  ter‐\nminate  itself.   This option may be used to disable this self-test for debugging pur‐\nposes.\n\n",
                    "long": "--disable-check-own-socket"
                },
                {
                    "name": "--use-standard-socket",
                    "content": "",
                    "long": "--use-standard-socket"
                },
                {
                    "name": "--no-use-standard-socket",
                    "content": "",
                    "long": "--no-use-standard-socket"
                },
                {
                    "name": "--use-standard-socket-p",
                    "content": "Since GnuPG 2.1 the standard socket is always used.  These options have  no  more  ef‐\nfect.  The command gpg-agent --use-standard-socket-p will thus always return success.\n\n\n--display string\n--ttyname string\n--ttytype string\n--lc-ctype string\n--lc-messages string\n--xauthority string\nThese options are used with the server mode to pass localization information.\n\n",
                    "long": "--use-standard-socket-p"
                },
                {
                    "name": "--keep-tty",
                    "content": "",
                    "long": "--keep-tty"
                },
                {
                    "name": "--keep-display",
                    "content": "Ignore  requests  to  change the current tty or X window system's DISPLAY variable re‐\nspectively.  This is useful to lock the pinentry to pop up at the tty or  display  you\nstarted the agent.\n\n\n--listen-backlog n\nSet the size of the queue for pending connections.  The default is 64.\n\n\n\n--extra-socket name\nThe  extra socket is created by default, you may use this option to change the name of\nthe socket.  To disable the creation of the socket use ``none'' or  ``/dev/null''  for\nname.\n\nAlso listen on native gpg-agent connections on the given socket.  The intended use for\nthis extra socket is to setup a Unix domain socket forwarding from a remote machine to\nthis  socket  on the local machine.  A gpg running on the remote machine may then con‐\nnect to the local gpg-agent and use its private  keys.   This  enables  decrypting  or\nsigning  data  on a remote machine without exposing the private keys to the remote ma‐\nchine.\n\n",
                    "long": "--keep-display"
                },
                {
                    "name": "--enable-extended-key-format",
                    "content": "",
                    "long": "--enable-extended-key-format"
                },
                {
                    "name": "--disable-extended-key-format",
                    "content": "Since version 2.2.22 keys are created in the extended private key format  by  default.\nChanging  the  passphrase of a key will also convert the key to that new format.  This\nkey format is supported since GnuPG version 2.1.12 and thus there should be no need to\ndisable it.  Anyway, the disable option still allows to revert to the old behavior for\nnew keys; be aware that keys are never migrated back to the old format.  If the enable\noption  has  been  used the disable option won't have an effect.  The advantage of the\nextended private key format is that it is text based and  can  carry  additional  meta\ndata.  In extended key format the OCB mode is used for key protection.\n\n\n",
                    "long": "--disable-extended-key-format"
                },
                {
                    "name": "--enable-ssh-support",
                    "content": "",
                    "long": "--enable-ssh-support"
                },
                {
                    "name": "--enable-putty-support",
                    "content": "The  OpenSSH  Agent  protocol  is  always  enabled,  but  gpg-agent  will only set the\nSSHAUTHSOCK variable if this flag is given.\n\nIn this mode of operation, the agent does not only implement the  gpg-agent  protocol,\nbut  also  the  agent  protocol  used  by OpenSSH (through a separate socket).  Conse‐\nquently, it should be possible to use the gpg-agent as a drop-in replacement  for  the\nwell known ssh-agent.\n\nSSH  Keys,  which  are to be used through the agent, need to be added to the gpg-agent\ninitially through the ssh-add utility.  When a key is added, ssh-add will ask for  the\npassword  of the provided key file and send the unprotected key material to the agent;\nthis causes the gpg-agent to ask for a passphrase, which is to be used for  encrypting\nthe newly received key and storing it in a gpg-agent specific directory.\n\nOnce  a  key  has been added to the gpg-agent this way, the gpg-agent will be ready to\nuse the key.\n\nNote: in case the gpg-agent receives a signature request, the user might  need  to  be\nprompted  for  a  passphrase, which is necessary for decrypting the stored key.  Since\nthe ssh-agent protocol does not contain a mechanism for telling  the  agent  on  which\ndisplay/terminal  it is running, gpg-agent's ssh-support will use the TTY or X display\nwhere gpg-agent has been started.  To switch this display to the current one, the fol‐\nlowing command may be used:\n\ngpg-connect-agent updatestartuptty /bye\n\nAlthough  all GnuPG components try to start the gpg-agent as needed, this is not possible for\nthe ssh support because ssh does not know about it.  Thus if no GnuPG tool which accesses the\nagent  has  been run, there is no guarantee that ssh is able to use gpg-agent for authentica‐\ntion.  To fix this you may start gpg-agent if needed using this simple command:\n\ngpg-connect-agent /bye\n\nAdding the --verbose shows the progress of starting the agent.\n\nThe --enable-putty-support is only available under Windows and allows the  use  of  gpg-agent\nwith  the  ssh  implementation  putty.   This is similar to the regular ssh-agent support but\nmakes use of Windows message queue as required by putty.\n\n\n",
                    "long": "--enable-putty-support"
                },
                {
                    "name": "--ssh-fingerprint-digest",
                    "content": "Select the digest algorithm used to compute ssh fingerprints that are communicated  to\nthe  user,  e.g.  in pinentry dialogs.  OpenSSH has transitioned from using MD5 to the\nmore secure SHA256.\n\n\n\n--auto-expand-secmem n\nAllow Libgcrypt to expand its secure memory area as required.  The optional value n is\na  non-negative  integer with a suggested size in bytes of each additionally allocated\nsecure memory area.  The value is rounded up to the next 32 KiB; usual  C  style  pre‐\nfixes are allowed.  For an heavy loaded gpg-agent with many concurrent connection this\noption avoids sign or decrypt errors due to out of secure memory error returns.\n\n\n--s2k-calibration milliseconds\nChange the default calibration time to milliseconds.  The given value is capped at  60\nseconds;  a value of 0 resets to the compiled-in default.  This option is re-read on a\nSIGHUP (or gpgconf --reload gpg-agent) and the S2K count is then re-calibrated.\n\n\n--s2k-count n\nSpecify the iteration count used to protect the passphrase.  This option can  be  used\nto  override  the  auto-calibration  done by default.  The auto-calibration computes a\ncount which requires by default 100ms to mangle a given passphrase.  See  also  --s2k-\ncalibration.\n\nTo view the actually used iteration count and the milliseconds required for an S2K op‐\neration use:\n\ngpg-connect-agent 'GETINFO s2kcount' /bye\ngpg-connect-agent 'GETINFO s2ktime' /bye\n\nTo view the auto-calibrated count use:\n\ngpg-connect-agent 'GETINFO s2kcountcal' /bye\n\n\n",
                    "long": "--ssh-fingerprint-digest"
                }
            ]
        },
        "EXAMPLES": {
            "content": "It is important to set the environment variable GPGTTY in your login shell, for  example  in\nthe ‘~/.bashrc’ init script:\n\nexport GPGTTY=$(tty)\n\nIf  you  enabled  the Ssh Agent Support, you also need to tell ssh about it by adding this to\nyour init script:\n\nunset SSHAGENTPID\nif [ \"${gnupgSSHAUTHSOCKby:-0}\" -ne $$ ]; then\nexport SSHAUTHSOCK=\"$(gpgconf --list-dirs agent-ssh-socket)\"\nfi\n\n\n\n",
            "subsections": []
        },
        "FILES": {
            "content": "There are a few configuration files needed for the operation of the agent.  By  default  they\nmay all be found in the current home directory (see: [option --homedir]).\n\n\n",
            "subsections": [
                {
                    "name": "gpg-agent.conf",
                    "content": "This is the standard configuration file read by gpg-agent on\nstartup.  It may contain any valid long option; the leading\ntwo dashes may not be entered and the option may not be abbreviated.\nThis file is also read after a SIGHUP however only a few\noptions will actually have an effect.  This default name may be\nchanged on the command line (see: [option --options]).\nYou should backup this file.\n\n"
                },
                {
                    "name": "trustlist.txt",
                    "content": "This is the list of trusted keys.  You should backup this file.\n\nComment lines, indicated by a leading hash mark, as well as empty\nlines are ignored.  To mark a key as trusted you need to enter its\nfingerprint followed by a space and a capital letter S.  Colons\nmay optionally be used to separate the bytes of a fingerprint; this\nenables cutting and pasting the fingerprint from a key listing output.  If\nthe line is prefixed with a ! the key is explicitly marked as\nnot trusted.\n\nHere is an example where two keys are marked as ultimately trusted\nand one as not trusted:\n\n.RS 2\n# CN=Wurzel ZS 3,O=Intevation GmbH,C=DE\nA6935DD34EF3087973C706FC311AA2CCF733765B S\n\n# CN=PCA-1-Verwaltung-02/O=PKI-1-Verwaltung/C=DE\nDC:BD:69:25:48:BD:BB:7E:31:6E:BB:80:D3:00:80:35:D4:F8:A6:CD S\n\n# CN=Root-CA/O=Schlapphuete/L=Pullach/C=DE\n!14:56:98:D3:FE:9C:CA:5A:31:6E:BC:81:D3:11:4E:00:90:A3:44:C2 S\n.fi\n\nBefore entering a key into this file, you need to ensure its\nauthenticity.  How to do this depends on your organisation; your\nadministrator might have already entered those keys which are deemed\ntrustworthy enough into this file.  Places where to look for the\nfingerprint of a root certificate are letters received from the CA or\nthe website of the CA (after making 100% sure that this is indeed the\nwebsite of that CA).  You may want to consider disallowing interactive\nupdates of this file by using the [option --no-allow-mark-trusted].\nIt might even be advisable to change the permissions to read-only so\nthat this file can't be changed inadvertently.\n\nAs a special feature a line include-default will include a global\nlist of trusted certificates (e.g. ‘/etc/gnupg/trustlist.txt’).\nThis global list is also used if the local list is not available.\n\nIt is possible to add further flags after the S for use by the\ncaller:\n\n\n\nrelax  Relax checking of some root certificate requirements.  As of now this\nflag allows the use of root certificates with a missing basicConstraints\nattribute (despite that it is a MUST for CA certificates) and disables\nCRL checking for the root certificate.\n\n\ncm     If validation of a certificate finally issued by a CA with this flag set\nfails, try again using the chain validation model.\n\n\n\n"
                },
                {
                    "name": "sshcontrol",
                    "content": "This file is used when support for the secure shell agent protocol has\nbeen enabled (see: [option --enable-ssh-support]). Only keys present in\nthis file are used in the SSH protocol.  You should backup this file.\n\nThe ssh-add tool may be used to add new entries to this file;\nyou may also add them manually.  Comment lines, indicated by a leading\nhash mark, as well as empty lines are ignored.  An entry starts with\noptional whitespace, followed by the keygrip of the key given as 40 hex\ndigits, optionally followed by the caching TTL in seconds and another\noptional field for arbitrary flags.  A non-zero TTL overrides the global\ndefault as set by --default-cache-ttl-ssh.\n\nThe only flag support is confirm.  If this flag is found for a\nkey, each use of the key will pop up a pinentry to confirm the use of\nthat key.  The flag is automatically set if a new key was loaded into\ngpg-agent using the option -c of the ssh-add\ncommand.\n\nThe keygrip may be prefixed with a ! to disable an entry.\n\nThe following example lists exactly one key.  Note that keys available\nthrough a OpenPGP smartcard in the active smartcard reader are\nimplicitly added to this list; i.e. there is no need to list them.\n\n# Key added on: 2011-07-20 20:38:46\n# Fingerprint:  5e:8d:c4:ad:e7:af:6e:27:8a:d6:13:e4:79:ad:0b:81\n34B62F25E277CF13D3C6BCEBFD3F85D08F0A864B 0 confirm\n\n"
                },
                {
                    "name": "private-keys-v1.d/",
                    "content": "This is the directory where gpg-agent stores the private keys.  Each\nkey is stored in a file with the name made up of the keygrip and the\nsuffix ‘key’.  You should backup all files in this directory\nand take great care to keep this backup closed away.\n\n\n\nNote  that  on  larger installations, it is useful to put predefined files into the directory\n‘/etc/skel/.gnupg’ so that newly created users start up with a  working  configuration.   For\nexisting  users  the  a  small  helper  script  is  provided to create these files (see: [ad‐\ndgnupghome]).\n\n\n\n\n"
                }
            ]
        },
        "SIGNALS": {
            "content": "A running gpg-agent may be controlled by signals, i.e. using the kill command to send a  sig‐\nnal to the process.\n\nHere is a list of supported signals:\n\n\n\nSIGHUP This  signal flushes all cached passphrases and if the program has been started with a\nconfiguration file, the configuration file is read again.  Only  certain  options  are\nhonored:  quiet,  verbose,  debug,  debug-all,  debug-level,  debug-pinentry, no-grab,\npinentry-program, pinentry-invisible-char, default-cache-ttl,  max-cache-ttl,  ignore-\ncache-for-signing, s2k-count, no-allow-external-cache, allow-emacs-pinentry, no-allow-\nmark-trusted, disable-scdaemon,  and  disable-check-own-socket.   scdaemon-program  is\nalso  supported  but  due to the current implementation, which calls the scdaemon only\nonce, it is not of much use unless you manually kill the scdaemon.\n\n\n\nSIGTERM\nShuts down the process but waits until all current requests  are  fulfilled.   If  the\nprocess  has received 3 of these signals and requests are still pending, a shutdown is\nforced.\n\n\nSIGINT Shuts down the process immediately.\n\n\nSIGUSR1\nDump internal information to the log file.\n\n\nSIGUSR2\nThis signal is used for internal purposes.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gpg(1), gpgsm(1), gpgconf(1), gpg-connect-agent(1), scdaemon(1)\n\nThe full documentation for this tool is maintained as a Texinfo manual.   If  GnuPG  and  the\ninfo program are properly installed at your site, the command\n\ninfo gnupg\n\nshould give you access to the complete manual including a menu structure and an index.\n\n\n\nGnuPG 2.2.27                                 2020-12-21                                 GPG-AGENT(1)",
            "subsections": []
        }
    },
    "summary": "gpg-agent - Secret key management for GnuPG",
    "flags": [
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--verbose",
            "arg": null,
            "description": "Outputs additional information while running. You can increase the verbosity by giv‐ ing several verbose commands to gpg-agent, such as ‘-vv’."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--quiet",
            "arg": null,
            "description": "Try to be as quiet as possible."
        },
        {
            "flag": "",
            "long": "--batch",
            "arg": null,
            "description": "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 key‐ word. 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 in‐ stead 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 de‐ bugging. --debug flags This option is only useful for debugging and the behavior may change at any time with‐ out notice. FLAGS are bit encoded and may be given in usual C-Syntax. The currently defined bits are: 0 (1) X.509 or OpenPGP protocol related data 1 (2) values of big number integers 2 (4) low level crypto operations 5 (32) memory allocation 6 (64) caching 7 (128) show memory statistics 9 (512) write hashed data to files named dbgmd-000* 10 (1024) trace Assuan protocol 12 (4096) bypass all certificate validation"
        },
        {
            "flag": "",
            "long": "--debug-all",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "",
            "long": "--debug-quick-random",
            "arg": null,
            "description": "This option inhibits the use of the very secure random quality level (Libgcrypt’s GCRYVERYSTRONGRANDOM) 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’."
        },
        {
            "flag": "",
            "long": "--debug-pinentry",
            "arg": null,
            "description": "This option enables extra debug information pertaining to the Pinentry. As of now it is only useful when used along with --debug 1024."
        },
        {
            "flag": "",
            "long": "--no-detach",
            "arg": null,
            "description": "Don't detach the process from the console. This is mainly useful for debugging."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--sh",
            "arg": null,
            "description": ""
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "--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."
        },
        {
            "flag": "",
            "long": "--grab",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--no-grab",
            "arg": null,
            "description": "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 ac‐ tually 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\\Soft‐‐ ware\\GNU\\GnuPG:DefaultLogFile, if set, is used to specify the logging output."
        },
        {
            "flag": "",
            "long": "--no-allow-mark-trusted",
            "arg": null,
            "description": "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."
        },
        {
            "flag": "",
            "long": "--allow-preset-passphrase",
            "arg": null,
            "description": "This option allows the use of gpg-preset-passphrase to seed the internal cache of gpg- agent with passphrases."
        },
        {
            "flag": "",
            "long": "--no-allow-loopback-pinentry",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--allow-loopback-pinentry",
            "arg": null,
            "description": "Disallow or allow clients to use the loopback pinentry features; see the option pinen‐‐ try-mode for details. Allow is the default. The --force option of the Assuan command DELETEKEY is also controlled by this option: The option is ignored if a loopback pinentry is disallowed."
        },
        {
            "flag": "",
            "long": "--no-allow-external-cache",
            "arg": null,
            "description": "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 imple‐ ment 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."
        },
        {
            "flag": "",
            "long": "--allow-emacs-pinentry",
            "arg": null,
            "description": "Tell Pinentry to allow features to divert the passphrase entry to a running Emacs in‐ stance. How this is exactly handled depends on the version of the used Pinentry."
        },
        {
            "flag": "",
            "long": "--ignore-cache-for-signing",
            "arg": null,
            "description": "This option will let gpg-agent bypass the passphrase cache for all signing operation. Note that there is also a per-session option to control this behavior but this command line option takes precedence. --default-cache-ttl n Set the time a cache entry is valid to n seconds. The default is 600 seconds. Each time a cache entry is accessed, the entry's timer is reset. To set an entry's maximum lifetime, use max-cache-ttl. Note that a cached passphrase may not be evicted immedi‐ ately from memory if no client requests a cache operation. This is due to an internal housekeeping function which is only run every few seconds. --default-cache-ttl-ssh n Set the time a cache entry used for SSH keys is valid to n seconds. The default is 1800 seconds. Each time a cache entry is accessed, the entry's timer is reset. To set an entry's maximum lifetime, use max-cache-ttl-ssh. --max-cache-ttl n Set the maximum time a cache entry is valid to n seconds. After this time a cache en‐ try will be expired even if it has been accessed recently or has been set using gpg- preset-passphrase. The default is 2 hours (7200 seconds). --max-cache-ttl-ssh n Set the maximum time a cache entry used for SSH keys is valid to n seconds. After this time a cache entry will be expired even if it has been accessed recently or has been set using gpg-preset-passphrase. The default is 2 hours (7200 seconds)."
        },
        {
            "flag": "",
            "long": "--enforce-passphrase-constraints",
            "arg": null,
            "description": "Enforce the passphrase constraints by not allowing the user to bypass them using the ``Take it anyway'' button. --min-passphrase-len n Set the minimal length of a passphrase. When entering a new passphrase shorter than this value a warning will be displayed. Defaults to 8. --min-passphrase-nonalpha n Set the minimal number of digits or special characters required in a passphrase. When entering a new passphrase with less than this number of digits or special characters a warning will be displayed. Defaults to 1. --check-passphrase-pattern file Check the passphrase against the pattern given in file. When entering a new passphrase matching one of these pattern a warning will be displayed. file should be an absolute filename. The default is not to use any pattern file. Security note: It is known that checking a passphrase against a list of pattern or even against a complete dictionary is not very effective to enforce good passphrases. Users will soon figure up ways to bypass such a policy. 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 Ask the user to change the passphrase if n days have passed since the last change. With --enforce-passphrase-constraints set the user may not bypass this check."
        },
        {
            "flag": "",
            "long": "--enable-passphrase-history",
            "arg": null,
            "description": "This option does nothing yet. --pinentry-invisible-char char This option asks the Pinentry to use char for displaying hidden characters. char must be one character UTF-8 string. A Pinentry may or may not honor this request. --pinentry-timeout n This option asks the Pinentry to timeout after n seconds with no user input. The de‐ fault value of 0 does not ask the pinentry to timeout, however a Pinentry may use its own default timeout value in this case. A Pinentry may or may not honor this request. --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 does not exist but a ‘pinentry-basic’ exist 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 for requests is passed to Pinentry, so that it can touch that file before exiting (it does this only in curses mode). This option changes the file passed to Pinentry to filename. The special name /dev/null may be used to completely disable this feature. Note that Pinentry will not create that file, it will only change 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."
        },
        {
            "flag": "",
            "long": "--disable-scdaemon",
            "arg": null,
            "description": "Do not make use of the scdaemon tool. This option has the effect of disabling the ability to do smartcard operations. Note, that enabling this option at runtime does not kill an already forked scdaemon."
        },
        {
            "flag": "",
            "long": "--disable-check-own-socket",
            "arg": null,
            "description": "gpg-agent employs a periodic self-test to detect a stolen socket. This usually means a second instance of gpg-agent has taken over the socket and gpg-agent will then ter‐ minate itself. This option may be used to disable this self-test for debugging pur‐ poses."
        },
        {
            "flag": "",
            "long": "--use-standard-socket",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--no-use-standard-socket",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--use-standard-socket-p",
            "arg": null,
            "description": "Since GnuPG 2.1 the standard socket is always used. These options have no more ef‐ fect. The command gpg-agent --use-standard-socket-p will thus always return success. --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."
        },
        {
            "flag": "",
            "long": "--keep-tty",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--keep-display",
            "arg": null,
            "description": "Ignore requests to change the current tty or X window system's DISPLAY variable re‐ spectively. This is useful to lock the pinentry to pop up at the tty or display you started the agent. --listen-backlog n Set the size of the queue for pending connections. The default is 64. --extra-socket name The extra socket is created by default, you may use this option to change the name of the socket. To disable the creation of the socket use ``none'' or ``/dev/null'' for name. Also listen on native gpg-agent connections on the given socket. The intended use for this extra socket is to setup 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 con‐ nect to the local gpg-agent and use its private keys. This enables decrypting or signing data on a remote machine without exposing the private keys to the remote ma‐ chine."
        },
        {
            "flag": "",
            "long": "--enable-extended-key-format",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--disable-extended-key-format",
            "arg": null,
            "description": "Since version 2.2.22 keys are created in the extended private key format by default. Changing the passphrase of a key will also convert the key to that new format. This key format is supported since GnuPG version 2.1.12 and thus there should be no need to disable it. Anyway, the disable option still allows to revert to the old behavior for new keys; be aware that keys are never migrated back to the old format. If the enable option has been used the disable option won't have an effect. The advantage of the extended private key format is that it is text based and can carry additional meta data. In extended key format the OCB mode is used for key protection."
        },
        {
            "flag": "",
            "long": "--enable-ssh-support",
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--enable-putty-support",
            "arg": null,
            "description": "The OpenSSH Agent protocol is always enabled, but gpg-agent will only set the SSHAUTHSOCK variable if this flag is given. In this mode of operation, the agent does not only implement the gpg-agent protocol, but also the agent protocol used by OpenSSH (through a separate socket). Conse‐ quently, it should be possible to use the gpg-agent as a drop-in replacement for the well known ssh-agent. SSH Keys, which 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: in case the gpg-agent receives a signature request, the user might need to be prompted for a passphrase, which is necessary for decrypting the stored key. Since the ssh-agent protocol does not contain a mechanism for telling the agent on which display/terminal it is running, gpg-agent's ssh-support will use the TTY or X display where gpg-agent has been started. To switch this display to the current one, the fol‐ lowing command may be used: gpg-connect-agent updatestartuptty /bye Although all GnuPG components try to start the gpg-agent as needed, this is not possible for the ssh support because ssh does not know about it. Thus if no GnuPG tool which accesses the agent has been run, there is no guarantee that ssh is able to use gpg-agent for authentica‐ tion. To fix this you may start gpg-agent if needed using this simple command: gpg-connect-agent /bye Adding the --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."
        },
        {
            "flag": "",
            "long": "--ssh-fingerprint-digest",
            "arg": null,
            "description": "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 pre‐ fixes 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 op‐ eration use: gpg-connect-agent 'GETINFO s2kcount' /bye gpg-connect-agent 'GETINFO s2ktime' /bye To view the auto-calibrated count use: gpg-connect-agent 'GETINFO s2kcountcal' /bye"
        }
    ],
    "examples": [
        "It is important to set the environment variable GPGTTY in your login shell, for  example  in",
        "the ‘~/.bashrc’ init script:",
        "export GPGTTY=$(tty)",
        "If  you  enabled  the Ssh Agent Support, you also need to tell ssh about it by adding this to",
        "your init script:",
        "unset SSHAGENTPID",
        "if [ \"${gnupgSSHAUTHSOCKby:-0}\" -ne $$ ]; then",
        "export SSHAUTHSOCK=\"$(gpgconf --list-dirs agent-ssh-socket)\"",
        "fi"
    ],
    "see_also": [
        {
            "name": "gpg",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gpg/1/json"
        },
        {
            "name": "gpgsm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gpgsm/1/json"
        },
        {
            "name": "gpgconf",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gpgconf/1/json"
        },
        {
            "name": "gpg-connect-agent",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gpg-connect-agent/1/json"
        },
        {
            "name": "scdaemon",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/scdaemon/1/json"
        }
    ]
}