| GPGCONF(1) | GNU Privacy Guard 2.4 | GPGCONF(1) |
gpgconf - Modify .gnupg home directories
gpgconf [options] --list-components
gpgconf [options] --list-options component
gpgconf [options] --change-options component
The gpgconf is a utility to automatically and reasonable safely query and modify configuration files in the ‘.gnupg’ home directory. It is designed not to be invoked manually by the user, but automatically by graphical user interfaces (GUI). ([Please note that currently no locking is done, so concurrent access should be avoided. There are some precautions to avoid corruption with concurrent usage, but results may be inconsistent and some changes may get lost. The stateless design makes it difficult to provide more guarantees.])
gpgconf provides access to the configuration of one or more components of the GnuPG system. These components correspond more or less to the programs that exist in the GnuPG framework, like GPG, GPGSM, DirMngr, etc. But this is not a strict one-to-one relationship. Not all configuration options are available through gpgconf. gpgconf provides a generic and abstract method to access the most important configuration options that can feasibly be controlled via such a mechanism.
gpgconf can be used to gather and change the options available in each component, and can also provide their default values. gpgconf will give detailed type information that can be used to restrict the user's input without making an attempt to commit the changes.
gpgconf provides the backend of a configuration editor. The configuration editor would usually be a graphical user interface program that displays the current options, their default values, and allows the user to make changes to the options. These changes can then be made active with gpgconf again. Such a program that uses gpgconf in this way will be called GUI throughout this section.
One of the following commands must be given:
gpg-connect-agent --dirmngr 'loadswdb --force' /bye
The following options may be used:
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.
This means that the changes will take effect at run-time, as far as this is possible. Otherwise, they will take effect at the next start of the respective backend programs.
The command --list-components will list all components that can be configured with gpgconf. Usually, one component will correspond to one GnuPG-related program and contain the options of that program's configuration file that can be modified using gpgconf. However, this is not necessarily the case. A component might also be a group of selected options from several programs, or contain entirely virtual options that have a special effect rather than changing exactly one option in one configuration file.
A component is a set of configuration options that semantically belong together. Furthermore, several changes to a component can be made in an atomic way with a single operation. The GUI could for example provide a menu with one entry for each component, or a window with one tabulator sheet per component.
The command --list-components lists all available components, one per line. The format of each line is:
name:description:pgmname:
Example:
$ gpgconf --list-components gpg:GPG for OpenPGP:/usr/local/bin/gpg2: gpg-agent:GPG Agent:/usr/local/bin/gpg-agent: scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon: gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm: dirmngr:Directory Manager:/usr/local/bin/dirmngr:
The command --check-programs is similar to --list-components but works on backend programs and not on components. It runs each program to test whether it is installed and runnable. This also includes a syntax check of all config file options of the program.
The command --check-programs lists all available programs, one per line. The format of each line is:
name:description:pgmname:avail:okay:cfgfile:line:error:
In the following example the dirmngr is not runnable and the configuration file of scdaemon is not okay.
$ gpgconf --check-programs gpg:GPG for OpenPGP:/usr/local/bin/gpg2:1:1: gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:1:1: scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:1:0: gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:1:1: dirmngr:Directory Manager:/usr/local/bin/dirmngr:0:0:
The command configuration file in the same manner as --check-programs, but only for the component component.
Every component contains one or more options. Options may be gathered into option groups to allow the GUI to give visual hints to the user about which options are related.
The command lists all options (and the groups they belong to) in the component component, one per line. component must be the string in the field name in the output of the --list-components command.
There is one line for each option and each group. First come all options that are not in any group. Then comes a line describing a group. Then come all options that belong into each group. Then comes the next group and so on. There does not need to be any group (and in this case the output will stop after the last non-grouped option).
The format of each line is:
name:flags:level:description:type:alt-type:argname:default:argdef:value
The following flag values are only defined for options (that is, if the group flag is not used).
The level of a group will always be the lowest level of all options it contains.
Basic types:
Complex types:
hostname:port:username:password:base_dn
More types will be added in the future. Please see the alt-type field for information on how to cope with unknown types.
The command to change the options of the component component to the specified values. component must be the string in the field name in the output of the --list-components command. You have to provide the options that shall be changed in the following format on standard input:
name:flags:new-value
The output of the command is the same as that of --check-options for the modified configuration file.
Examples:
To set the force option, which is of basic type none (0):
$ echo 'force:0:1' | gpgconf --change-options dirmngr
To delete the force option:
$ echo 'force:16:' | gpgconf --change-options dirmngr
The --runtime option can influence when the changes take effect.
Some legacy applications look at the global configuration file for the gpgconf tool itself; this is the file ‘gpgconf.conf’. Modern applications should not use it but use per component global configuration files which are more flexible than the ‘gpgconf.conf’. Using both files is not suggested.
The colon separated listing format is record oriented and uses the first field to identify the record type:
k:user:group:
r:::component:option:flag:value:
Unknown record types should be ignored. Note that there is intentionally no feature to change the global option file through gpgconf.
The GnuPG Project operates a server to query the current versions of software packages related to GnuPG. gpgconf can be used to access this online database. To allow for offline operations, this feature works by having dirmngr download a file from https://versions.gnupg.org, checking the signature of that file and storing the file in the GnuPG home directory. If gpgconf is used and dirmngr is running, it may ask dirmngr to refresh that file before itself uses the file.
The command --query-swdb returns information for the given package in a colon delimited format:
More fields may be added in future to the output.
Under Windows this file is used to install GnuPG as a portable
application. An empty file named ‘gpgconf.ctl’ is
expected in
the same directory as the tool ‘gpgconf.exe’. The
root of the
installation is then that directory; or, if
‘gpgconf.exe’ has
been installed directly below a directory named
‘bin’, its parent
directory. You also need to make sure that the following directories
exist and are writable: ‘ROOT/home’ for the GnuPG
home and
‘ROOT/var/cache/gnupg’ for internal cache files.
gpg(1), gpgsm(1), gpg-agent(1), scdaemon(1), dirmngr(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.
| 2024-11-22 | GnuPG 2.4.7 |