Section: GNU Privacy Guard (1)
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 GnuPG, 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 allows to display 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:
The following options may be used:
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 programs 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 argument --list-components lists all available components, one per line. The format of each line is:
$ 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 argument --check-programs lists all available programs, one per line. The format of each line is:
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 argument 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:
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.
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:
The output of the command is the same as that of --check-options for the modified configuration file.
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.
Sometimes it is useful for applications to look at the global options file gpgconf.conf. The colon separated listing format is record oriented and uses the first field to identify the record type:
Unknown record types should be ignored. Note that there is intentionally no feature to change the global option file through gpgconf.
If this file exists, it is processed as a global configuration file.
A commented example can be found in the examples directory of
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
should give you access to the complete manual including a menu structure and an index.
Tutoriais de Tecnologia Web