Source other configuration file in gpg.conf

Is there any way to source a secondary configuration file inside the usual gpg.conf?

I'd like to share a set of common configuration options across different workstations but I also need several local customizations.


GnuPG does not allow sourcing configuration files from within configuration files:

--options file
      Read options from file and do not try to read them from the default
      options file in the homedir (see --homedir). This option is ignored
      if used in an options file.

You can use the --options command line argument multiple times, though; so you might create an alias or wrapper script like this, loading a shared and a local configuration file:

gpg --options ~/.dotfiles/gnupg/gpg.conf --options ~/.gnupg/gpg.conf

Why not just make the gpg.conf file and then copy it to the second workstation? I can not envision the settings needing to change (much). Note that your keys are stored separately.

You could store the gpg.conf file on a secure network file share both workstations could access and then reference it with the command below. While not recommended it is possible. [If an attacker controlled gpg.conf they could try to downgrade you to old insecure DES encryption or many other undesirable things]

gpg.conf
This is the standard configuration file read by gpg2 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 default name may be changed on the >command line (see gpg-option –options). You should backup this file.

gpg2 --options [config file in non default location]

To change the default signing key:

--default-key name

Use name as the default key to sign with. If this option is not used, the default key is the first key found in the secret keyring. Note that -u or

--local-user overrides this option.

Sample gpg.conf file designed with High Security in mind (may need to remove tor features if you don't use) Duraconfig : https://github.com/ioerror/duraconf/blob/master/configs/gnupg/gpg.conf

Discussion of increasing gpg.conf security

GPG Config File and command line options