17 Sep 2008, 10:07

GnuPG: Change the keyring location

Share

There are several ways to tell GnuPG a custom keyring location.

  • Move .gnupg and set GNUPGHOME to the new location
  • Move .gnupg and use –homedir=<dir> on every invocation of GnuPG
  • Leave .gnupg, only move the keyring and set path to gpg.conf:
no-default-keyring
primary-keyring <dir>/pubring.gpg
secret-keyring <dir>/secring.gpg
trustdb-name <dir>/trustdb.gpg
keyring <dir>/pubring.gpg