Receiving a key from a keyserver in gnupg

// , GnuPG (used by the gpg command) is just a client made for use of the OpenPGP system.

OpenPGP has a lot of parts. One of those parts, the local client, is right there, on your hardware: GnuPG. Another part, though, is the keyserver.

GnuPG is going to access a keyserver to obtain a key.

The keyserver will look up the key by its "fingerprint", that is, a special name designed to be verifiably unique to that key.
Here follows an example command to use the GnuPG package's gpg command to receive a key (--recv-keys) with the fingerprint 7CE8FC69BE118222:

$ gpg --recv-keys 7CE8FC69BE118222

Let me break this down, piece by piece:

$ gpg

This is the basic command, on most popular Linux systems available, to run the GnuPG program ("option flags" like this are used to modify Linux commands, and the "option flags" usually start with -- or -).

--recv-keys 

This "option flag" tells GnuPG to import keys from a keyserver.

7CE8FC69BE118222

This tells GnuPG which key to import.

Assuming that you're on a Debian system, a keyserver need not be specified, but adding --keyserver certserver.pgp.com will do the trick.

From the info page on GnuPG (the gpg info page can be accessed by running the command info gpg):

--recv-keyskey IDs

Import the keys with the given key IDs from a keyserver. Option --keyserver must be used to give the name of this keyserver.


Turns out I was missing two dashes, the correct command is gpg --recv-keys $KEY (where $KEY is replaced by the key) in the command line.