--keyring /dir/?? Use --homedir instead.

John Kane jkane89@softhome.net
Wed Jul 11 02:56:01 2001


Q: I want to put my keyring in a different directory; why
    does gnupg keep making files in the old directory?

A: Gnupg keeps several files in a special 'homedir' directory.
These include the "options" file, pubring.gpg, secring.gpg,
the trustdb, and others.  Gnupg will always create and use
these files.  On unices, the homedir is normally ~/.gnupg;
on Windows, it's normally "C:\gnupg\".

If you want to put your keyrings somewhere else, you should
probably NOT be using the "--keyring" command. You should
use "--homedir /my/path/" to make gnupg create ALL its files
in that directory. Your keyring will be "/my/path/pubring.gpg".

Why not use "--keyring"?  It's not designed to allow you to
use a new keyring *instead* of the original pubring; it's
designed to let you use *several* keyrings in *addition* to
the default pubring.  All at the same time.

If the commands "keyring a.gpg" and "keyring b.gpg" are in
your options file, gnupg looks in your homedir for pubring.gpg,
a.gpg, and b.gpg.  It will search all three (in that order) to try
to find a matching key.  Gnupg will *always* load pubring
unless you put "no-default-keyring" in your options.