How do you exchange keys with via key server?
Worked example would be great with send and find+retrieve.
I know gpg --send-keys
is the command but how do you find the keyid (tried all output from –--list-keys
). --keyserver keys.gpugp.net
works with --send-keys
but not with --search-keys
(says bad uri). Which keys should I publish? What key server to publish to. Despite being a pretty simple program, the gnugp docs are terrible (broken links, missing info).
Best Answer
What Went Wrong
You're dealing with two problems:
gpg --search-keys
searches keyservers, not locally. Usegpg --list-keys
instead.keys.gnupg.net
, notkeys.gpugp.net
(typo). Additionally, you have to prefix a protocol,hkp://
is supported by most keyservers.Relevant Commands for Exchanging Keys
gpg --send-keys [keyid]
: Send key id to a keyservergpg --recv-keys [keyid]
: Fetch key id from a keyservergpg --search-keys [needle]
: Search for keys on a keyserver that contain "needle", eg. in a UIDgpg --list-keys [needle]
: List all local keys that contain "needle", eg. in a UIDTo select another keyserver than the default one configured, use
--keyserver [URI]
. Make sure to use a complete and valid URI likehkp://pool.sks-keyservers.net
, orhkp://keys.gnupg.net
(which actually refers to the SKS keyserver pool ourdays).