DIRMNGR(8)
๐ธ NAME ๐ธ
okay bestie, this is dirmngr(8) from GNU Privacy Guard 2.6 โ literally GnuPG's network access daemon. ๐
โจ
๐ ๏ธ SYNOPSIS ๐ ๏ธ
dirmngr [options] command [args]
๐ฌ DESCRIPTION ๐ฌ
Since version 2.1 of GnuPG, dirmngr takes care of accessing the OpenPGP keyservers. As with previous versions it is also used as a server for managing and downloading certificate revocation lists (CRLs) for X.509 certificates, downloading X.509 certificates, and providing access to OCSP providers. Dirmngr is invoked internally by gpg, gpgsm, or via the gpg-connect-agent tool. no cap, it's giving background-network-main-character energy. ๐
๐ COMMANDS ๐
Commands are not distinguished from options except for the fact that only one command is allowed. yes, bestie, it's that kind of party. ๐ซถ
--versionโ Print the program version and licensing information. Note that you cannot abbreviate this command. periodt.--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. This is only used for testing.--daemonโ Run in background daemon mode and listen for commands on a socket. This is the waydirmngris started on demand by the other GnuPG components. To force startingdirmngrit is in general best to usegpgconf --launch dirmngr.--deprecated-supervisedโ Run in the foreground, sending logs to stderr, and listening on file descriptor 3, which must already be bound to a listening socket.
๐จ Deprecated alert: This option is not supported on Windows and deprecated since version 2.3.6. To clarify its deprecation the option has been renamed with version 2.5.3.
--list-crlsโ List the contents of the CRL cache on stdout. This is probably only useful for debugging purposes.--load-crl fileโ This command requires a filename as additional argument, and it will make Dirmngr try to import the CRL in file into its cache. Note, that this is only possible if Dirmngr is able to retrieve the CA's certificate directly by its own means. In general it is better to use gpgsm's--call-dirmngr loadcrl filenamecommand so that gpgsm can help dirmngr.--fetch-crl urlโ This command requires an URL as additional argument, and it will make dirmngr try to retrieve and import the CRL from that url into its cache. This is mainly useful for debugging purposes. Thedirmngr-clientprovides the same feature for a running dirmngr.--shutdownโ This command shuts down a running instance of Dirmngr. This command has currently no effect.--flushโ This command removes all CRLs from Dirmngr's cache. Client requests will thus trigger reading of fresh CRLs.
๐ OPTIONS ๐
Note that all long options with the exception of --options and --homedir may also be given in the configuration file after stripping off the two leading dashes. iykyk. ๐
--options fileโ Reads configuration from file instead of from the default per-user configuration file. The default configuration file is nameddirmngr.confand expected in the home directory.--homedir dirโ Set the name of the home directory to dir. This option is only effective when used on the command line. The default is the directory named.gnupgdirectly below the home directory of the user unless the environment variableGNUPGHOMEhas been set in which case its value will be used. Many kinds of data are stored within this directory.-v--verboseโ Outputs additional information while running. You can increase the verbosity by giving several verbose commands to dirmngr, such as-vv.--log-file fileโ Append all logging output to file. This is very helpful in seeing what the agent actually does. Usesocket://to log to socket.--compatibility-flags flagsโ Set compatibility flags to work around certain problems or to emulate bugs. The flags are given as a comma separated list of flag names and are OR-ed together. The special flag"none"clears the list and allows one to start over with an empty list. To get a list of available flags the sole word"help"can be used.--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. Alternatively epoch may be given as a full ISO time string (e.g."20070924T154812").--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--tls-debug levelโ Enable debugging of the TLS layer at level. The details of the debug level depend on the used TLS library and are not set in stone.--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.--disable-check-own-socketโ On some platforms dirmngr is able to detect the removal of its socket file and shutdown itself. This option disables this self-test for debugging purposes.-s,--sh,-c,--cshโ Format the info output in daemon mode for use with the standard Bourne shell respective the C-shell. The default is to guess it based on the environment variableSHELLwhich is in almost all cases sufficient.--forceโ Enabling this option forces loading of expired CRLs; this is only useful for debugging.--use-tor,--no-use-torโ The option--use-torswitches Dirmngr and thus GnuPG into "Tor mode" to route all network access via Tor (an anonymity network). Certain other features are disabled in this mode. The effect of--use-torcannot be overridden by any other command or even by reloading dirmngr. The use of--no-use-tordisables the use of Tor. The default is to use Tor if it is available on startup or after reloading dirmngr. The test on the availability of Tor is done by trying to connect to a SOCKS proxy at either port 9050 or 9150; if another type of proxy is listening on one of these ports, you should use--no-use-tor. ๐๐ฅ--standard-resolverโ This option forces the use of the system's standard DNS resolver code. This is mainly used for debugging. Note that on Windows a standard resolver is not used and all DNS access will return the errorNot Implementedif this option is used. Using this together with enabled Tor mode returns the errorNot Enabled.--recursive-resolverโ When possible use a recursive resolver instead of a stub resolver.--resolver-timeout nโ Set the timeout for the DNS resolver to N seconds. The default is 30 seconds.--connect-timeout n,--connect-quick-timeout nโ Set the timeout for HTTP and generic TCP connection attempts to N seconds. The value set with the quick variant is used when the--quickoption has been given to certain Assuan commands. The quick value is capped at the value of the regular connect timeout. The default values are 15 and 2 seconds. Note that the timeout values are for each connection attempt; the connection code will attempt to connect all addresses listed for a server.--listen-backlog nโ Set the size of the queue for pending connections. The default is 64.--allow-version-checkโ Allow Dirmngr to connect tohttps://versions.gnupg.orgto get the list of current software versions. If this option is enabled the list is retrieved in case the local copy does not exist or is older than 5 to 7 days. See the option--query-swdbof the commandgpgconffor more details. Note, that regardless of this option a version check can always be triggered using this command:
gpg-connect-agent --dirmngr 'loadswdb --force' /bye
--keyserver nameโ Use name as your keyserver. This is the server thatgpgcommunicates with to receive keys, send keys, and search for keys. The format of the name is a URI:scheme:[//]keyservername[:port]The scheme is the type of keyserver:"hkp"for the HTTP (or compatible) keyservers or"ldap"for the LDAP keyservers. Note that your particular installation of GnuPG may have other keyserver types available as well. Keyserver schemes are case-insensitive. After the keyserver name, optional keyserver configuration options may be provided. These are the same as the--keyserver-optionsofgpg, but apply only to this particular keyserver.
Some keyservers synchronize with each other, so there is not always a need to send keys to more than one server. Some keyservers use round robin DNS to give a different keyserver each time you use it. ๐๐
If exactly two keyservers are configured and only one is a Tor hidden service (.onion), Dirmngr selects the keyserver to use depending on whether Tor is locally running or not. The check for a running Tor is done for each new connection. ๐ง
There is no default keyserver since version 2.5.3. (yes bestie, you have to bring your own ๐ )
Windows users with a keyserver running on their Active Directory may use the short form ldap:/// for name to access this directory.
For accessing anonymous LDAP keyservers name is in general just ldaps://ldap.example.com. A BaseDN parameter should never be specified. If authentication is required things are more complicated and two methods are available:
The modern method (since version 2.2.28) is to use the very same syntax as used with the option --ldapserver. Please see over there for details; here is an example:
keyserver ldap:ldap.example.com::uid=USERNAME,ou=GnuPG Users,
dc=example,dc=com:PASSWORD::starttls
The other method is to use a full URL for name; for example:
keyserver ldaps://ldap.example.com/????bindname=uid=USERNAME
%2Cou=GnuPG%20Users%2Cdc=example%2Cdc=com,password=PASSWORD
Put this all on one line without any spaces and keep the %2C as given. Replace USERNAME, PASSWORD, and the dc parts according to the instructions received from your LDAP administrator. Note that only simple authentication (i.e., cleartext passwords) is supported and thus using ldaps is strongly suggested (since 2.2.28 "ldaps" defaults to port 389 and uses STARTTLS). On Windows authentication via AD can be requested by adding gpgNtds=1 after the fourth question mark instead of the bindname and password parameter.
--nameserver ipaddrโ In "Tor mode" Dirmngr uses a public resolver via Tor to resolve DNS names. If the default public resolver, which is8.8.8.8, shall not be used, a different one can be given using this option. Note that a numerical IP address must be given (IPv6 or IPv4) and that no error checking is done for ipaddr. ๐--disable-ipv4,--disable-ipv6โ Disable the use of all IPv4 or IPv6 addresses. ๐ซ--disable-ldapโ Entirely disables the use of LDAP. like, gone-gone, bestie ๐--disable-httpโ Disable the use of HTTP to fetch CRLs. This also disables OCSP requests as a side-effect. HTTP access to keyservers and to other files will still work. This is a legacy option from a time before CRL distribution points became common; it is better to use the explicit option--ignore-http-dpif the goal is to avoid fetching CRLs via HTTP.--ignore-http-dpโ When looking for the location of a CRL, the to-be-tested certificate usually contains so called CRL Distribution Point (DP) entries which are URLs describing the way to access the CRL. The first found DP entry is used. With this option all entries using the HTTP scheme are ignored when looking for a suitable DP.--ignore-ldap-dpโ This is similar to--ignore-http-dpbut ignores entries using the LDAP scheme. Both options may be combined resulting in ignoring DPs entirely. (combo move โจ)--ignore-ocsp-service-urlโ Ignore all OCSP URLs contained in the certificate. The effect is to force the use of the default responder.--honor-http-proxyโ If the environment variablehttp_proxyhas been set, use its value to access HTTP servers. If on Windows the option is used but the environment variable is not set, the proxy settings are taken from the system.--http-proxy host[:port]โ Use host and port to access HTTP servers. The use of this option overrides the environment variablehttp_proxyregardless whether--honor-http-proxyhas been set. ๐ค--ldap-proxy host[:port]โ Use host and port to connect to LDAP servers. If port is omitted, port389(standard LDAP port) is used. This overrides any specified host and port part in a LDAP URL and will also be used if host and port have been omitted from the URL.--only-ldap-proxyโ Never use anything else but the LDAP "proxy" as configured with--ldap-proxy. Usually dirmngr tries to use other configured LDAP server if the connection using the "proxy" failed. this one is like, "no backup plan, we ball" ๐--ldapserverlist-file fileโ Read the list of LDAP servers to consult for CRLs and X.509 certificates from file instead of the default per-user ldap server list file. The default value for file isdirmngr_ldapservers.conf.
This server list file contains one LDAP server per line in the format
hostname:port:username:password:base_dn:flags
Lines starting with a # are comments.
Note that as usual all strings entered are expected to be UTF-8 encoded. Obviously this will lead to problems if the password has originally been encoded as Latin-1. There is no other solution here than to put such a password in the binary encoding into the file (i.e., non-ascii characters won't show up readable). ([The gpgconf tool might be helpful for frontends as it enables editing this configuration file using percent-escaped strings.]) ๐ซถ
--ldapserver specโ This is an alternative way to specify LDAP servers for CRL and X.509 certificate retrieval. If this option is used the servers configured indirmngr_ldapservers.conf(or the file given by--ldapserverlist-file) are cleared. Note thatdirmngr_ldapservers.confis not read again by a reload signal. However,--ldapserveroptions are read again.
spec is either a proper LDAP URL or a colon delimited list of the form
hostname:port:username:password:base_dn:flags:
with an optional prefix of ldap: (but without the two slashes which would turn this into a proper LDAP URL). flags is a list of one or more comma delimited keywords:
plainโ The default: Do not use a TLS secured connection at all; the default port is389.starttlsโ Use STARTTLS to secure the connection; the default port is389.ldaptlsโ Tunnel LDAP through a TLS connection; the default port is636.ntdsโ On Windows authenticate the LDAP connection using the Active Directory with the current user.areconlyโ On Windows use only the A or AAAA record when resolving the LDAP server name.
Note that in an URL style specification the scheme ldaps:// refers to STARTTLS and not to LDAP-over-TLS. read that twice bestie, it's giving trap ๐ชค
--ldaptimeout secsโ Specify the number of seconds to wait for an LDAP query before timing out. The default are15seconds.0will never timeout. (patience of an angel, or none at all ๐ธ)--add-serversโ This option makes dirmngr add any servers it discovers when validating certificates against CRLs to the internal list of servers to consult for certificates and CRLs. This option should in general not be used.
This option might be useful when trying to validate a certificate that has a CRL distribution point that points to a server that is not already listed in the ldapserverlist. Dirmngr will always go to this server and try to download the CRL, but chances are high that the certificate used to sign the CRL is located on the same server. So if dirmngr doesn't add that new server to list, it will often not be able to verify the signature of the CRL unless the --add-servers option is used.
Caveat emptor: Using this option may enable denial-of-service attacks and leak search requests to unknown third parties. This is because arbitrary servers are added to the internal list of LDAP servers which in turn is used for all unspecific LDAP queries as well as a fallback for queries which did not return a result. โ ๏ธ like, fr fr, be careful with this one
--allow-ocspโ This option enables OCSP support if requested by the client. ๐
OCSP requests are rejected by default because they may violate the privacy of the user; for example it is possible to track the time when a user is reading a mail. (yeah, that's a big yikes ๐)
--ocsp-responder urlโ Use url as the default OCSP Responder if the certificate does not contain information about an assigned responder. Note, that--ocsp-signermust also be set to a valid certificate.--ocsp-signer fpr|fileโ Use the certificate with the fingerprint fpr to check the responses of the default OCSP Responder. Alternatively a filename can be given in which case the response is expected to be signed by one of the certificates described in that file. Any argument which contains a slash, dot or tilde is considered a filename. Usual filename expansion takes place: A tilde at the start followed by a slash is replaced by the content ofHOME, no slash at start describes a relative filename which will be searched at the home directory. To make sure that the file is searched in the home directory, either prepend the name with"./"or use a name which contains a dot.
If a response has been signed by a certificate described by these fingerprints no further check upon the validity of this certificate is done.
The format of the FILE is a list of SHA-1 fingerprint, one per line with optional colons between the bytes. Empty lines and lines prefix with a hash mark are ignored. ๐
--ocsp-max-clock-skew nโ The number of seconds a skew between the OCSP responder and them local clock is accepted. Default is600(10 minutes).--ocsp-max-period nโ Seconds a response is at maximum considered valid after the time given in the thisUpdate field. Default is7776000(90 days).--ocsp-current-period nโ The number of seconds an OCSP response is considered valid after the time given in the NEXT_UPDATE datum. Default is10800(3 hours).--max-replies nโ Do not return more that n items in one query. The default is10. โจ--ignore-cert-extensionoid โ adds oid to the list of ignored certificate extensions. That oid should be in dotted decimal form, like2.5.29.3. You can use this option more than once. If a critical-flagged certificate extension matches one of the OIDs on the list, it gets treated like itโs actually handled, so the certificate wonโt get rejected just because of an unknown critical extension. โ ๏ธ Use this one with care, bestie โ extensions are usually flagged critical for a reason.--ignore-crl-extensionoid โ adds oid to the list of ignored CRL extensions. Same dotted decimal form, same deal. Critical-flagged CRL extensions matching one of the listed OIDs are treated as if theyโre actually handled, so the certificate wonโt be rejected due to an unknown critical extension. โ ๏ธ Again: use with care, because critical usually means critical for a reason.--ignore-certfpr|file โ completely ignores certificates with the fingerprint fpr. You can also hand it a filename instead, in which case every certificate described in that file gets ignored. Any argument containing a slash, dot or tilde counts as a filename. Usual filename expansion happens: a tilde at the start followed by a slash gets replaced by the content ofHOME; no slash at the start means a relative filename thatโll be searched at the home directory. To be sure the file gets searched in the home directory, either prepend the name with"./"or use a name containing a dot. The file format is a list of SHA-1 fingerprint, one per line with optional colons between the bytes. Empty lines and lines prefixed with a hash mark are ignored. ๐
This option is super handy as a quick workaround to exclude certain certificates from the system store.
--hkp-cacertfile โ uses the root certificates in file for verifying the TLS certificates used withhkps(thatโs keyserver access over TLS, iykyk). If the file is in PEM format, a suffix of.pemis expected for file. You can give this option multiple times to add more root certificates. Tilde expansion is supported. โจ
If thereโs no hkp-cacert directive present, dirmngr will use the system CAs.
๐ EXAMPLES ๐
Hereโs how to show dirmngrโs internal table of OpenPGP keyserver addresses. The output is for debugging purposes and is not part of a defined API, so donโt go building your whole personality on it.
gpg-connect-agent --dirmngr 'keyserver --hosttable' /bye
To inhibit the use of a particular host you noticed in one of the keyserver pools, you may use:
gpg-connect-agent --dirmngr 'keyserver --dead pgpkeys.bnd.de' /bye
And the description of the keyserver command can be printed using:
gpg-connect-agent --dirmngr 'help keyserver' /bye
๐ FILES ๐
Dirmngr makes use of several directories when running in daemon mode. There are a few configuration files to control the operation of dirmngr. By default they may all be found in the current home directory (peep the --homedir option).
dirmngr.conf
This is the standard configuration file read by dirmngr 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, not all options will actually have an effect. The default name may be changed on the command line (see the --options option). You should back up this file, fr fr. ๐พ
/etc/gnupg/trusted-certs
This directory should be filled with certificates of Root CAs youโre trusting when checking CRLs and signing OCSP Responses.
Usually these are the same certificates you use with the applications making use of dirmngr. Each of these certificate files is expected to contain exactly one DER encoded certificate in a file with the suffix .crt or .der. Dirmngr reads those certificates on startup and when given a SIGHUP. Certificates that arenโt readable or donโt make up a proper X.509 certificate are ignored; check the log file for details.
Applications using dirmngr (e.g., gpgsm) can request these certificates to complete a trust chain in the same way as with the extra-certs directory (see below).
Note that for OCSP responses, the certificate specified using the option --ocsp-signer is always considered valid to sign OCSP requests. ๐
/etc/gnupg/extra-certs
This directory may contain extra certificates that are preloaded into the internal cache on startup. Applications using dirmngr (e.g., gpgsm) can request cached certificates to complete a trust chain. This is convenient when you have a couple of intermediate CA certificates or certificates usually used to sign OCSP responses. These certificates are tried first before going out to the net to look for them. They must also be DER encoded and suffixed with .crt or .der.
~/.gnupg/crls.d
This directory is used to store cached CRLs. The crls.d part will be created by dirmngr if it does not exist, but you need to make sure that the upper directory exists. ๐๏ธ
Several options control the use of trusted certificates for TLS and CRLs. Hereโs an overview of the use and origin of those Root CA certificates:
System
These System root certificates are used by: FIXME ๐ญ (yes, thatโs literally in the source)
The origin of the system-provided certificates depends on the platform. On Windows, all certificates from the Windows System Stores ROOT and CA are used.
On other platforms, the certificates are read from the first file found from this list: /etc/ssl/ca-bundle.pem, /etc/ssl/certs/ca-certificates.crt, /etc/pki/tls/cert.pem, /usr/local/share/certs/ca-root-nss.crt, /etc/ssl/cert.pem.
GnuPG
The GnuPG-specific certificates stored in the directory /etc/gnupg/trusted-certs are only used to validate CRLs.
OpenPGP keyserver
For accessing the OpenPGP keyservers, the only certificates used are those set with the configuration option hkp-cacert.
OpenPGP keyserver pool
This is usually only one certificate, read from the file /usr/share/gnupg/gnupg/sks-keyservers.netCA.pem. If this certificate exists, itโs used to access the special keyservers hkps.pool.sks-keyservers.net (or hkps://keys.gnupg.net).
Please note that gpgsm accepts Root CA certificates for its own purposes only if theyโre listed in its file trustlist.txt. Dirmngr does not make use of this list โ except FIXME. ๐ซ
๐ NOTES ๐
To be able to see diagnostics, itโs often useful to put at least the following lines into the configuration file ~/gnupg/dirmngr.conf:
log-file ~/dirmngr.log
verbose
You may want to check the log file to see whether all desired root CA certificates are correctly loaded. ๐
To be able to perform OCSP requests, you probably want to add the line:
allow-ocsp
To make sure new options are read, or that after installing a new GnuPG version the right dirmngr version is running, you should kill an existing dirmngr so a new instance is started as needed by the other components:
gpgconf --kill dirmngr
Direct interaction with the dirmngr is possible by using the command:
gpg-connect-agent --dirmngr
Enter HELP at the prompt to see a list of commands, and enter HELP followed by a command name to get help on that command. ๐ฌ
โก SIGNALS โก
A running dirmngr may be controlled by signals, i.e., using the kill command to send a signal to the process.
Hereโs a list of supported signals:
SIGHUPโ flushes all internally cached CRLs as well as any cached certificates. Then the certificate cache is reinitialized as on startup. Options are re-read from the configuration file. Instead of sending this signal, itโs better to usegpgconf --reload dirmngr.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. You may also usegpgconf --kill dirmngrinstead of this signal.SIGINTโ shuts down the process immediately. No waiting, no vibes, just gone. ๐SIGUSR1โ prints some caching statistics to the log file. ๐
๐ฆ SEE ALSO ๐ฆ
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 a wrap on DIRMNGR(8), bestie โ brought to you by GnuPG 2.5.5, dated 2025-02-19. Now go forth and let your keyservers slay โจ๐
๐ซถ
๐ฆ where this page comes from
- opensuse-leap 16.0: dirmngr 2.5.5-160000.6.1 ยท GPL-3.0-or-later
- opensuse-leap 16.0: dirmngr 2.5.5-160000.6.1 ยท GPL-3.0-or-later
- opensuse-leap 16.0: dirmngr 2.5.5-160000.6.1 ยท GPL-3.0-or-later
- opensuse-leap 16.0: dirmngr 2.5.5-160000.6.1 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms