Proper way to set up or change a preferred gpg keyserver in ubuntu 20.04?
Where is the default ubuntu keyserver setting located (what file can I modify to change the default keyserver permanently in ubuntu?)?
By default this is in ~/.gnupg/gpg.conf
. If you do not have this file/directory, you can invoke gpg --version
in order to see where your copy of GPG is set to store its configuration.
How Can I set 2 keyservers (in ubuntu) with their order being their preference in which ubuntu places requests to them? Such that keyserver1=https://keys.openpgp.org/ and keyserver2=hkp://pool.sks-keyservers.net, so that if a key cannot be found on keyserver1, then ubuntu searches for the key on keyserver2?
In the configuration file, which includes instructions as a comment, you will find the following:
> # GnuPG can automatically locate and retrieve keys as needed using the
> # auto-key-locate option. This happens when encrypting to an email
> # address (in the "[email protected]" form), and there are no
> # [email protected] keys on the local keyring. This option takes the
> # following arguments, in the order they are to be tried:
> #
> # cert = locate a key using DNS CERT, as specified in RFC-4398.
> # GnuPG can handle both the PGP (key) and IPGP (URL + fingerprint)
> # CERT methods.
> #
> # pka = locate a key using DNS PKA.
> #
> # ldap = locate a key using the PGP Universal method of checking
> # "ldap://keys.(thedomain)". For example, encrypting to
> # [email protected] will check ldap://keys.example.com.
> #
> # keyserver = locate a key using whatever keyserver is defined using
> # the keyserver option.
> #
> # You may also list arbitrary keyservers here by URL.
The relevant part is the fifth line: "in the order they are to be tried"