6

Tutorials online say to use the option --keyserver, like this:

gpg --send-keys <keyID> --keyserver 'hkp://keyserver.ubuntu.com:11371'

but gpg doesn't recognise the option --keyserver. What am I doing wrong?

6
  • 1
    I can't see a difference between these two. BTW gpg (GnuPG) 1.4.12 supports and it's man page is not silent about --keyserver
    – Serge
    Sep 30, 2012 at 0:30
  • @Serge the commands has an argument <keyID> that isn't visible because was interpreted as an HTML tag. I suggested an edit to correct this. Sep 30, 2012 at 0:41
  • 1
    @Korgan, You asked a question along with the answer. You may want create a new answer and mark as solved. It's OK. Sep 30, 2012 at 0:48
  • The right thing will be: gpg --keyserver 'hkp://keyserver.ubuntu.com:11371' --send-keys <keyid>* - I would not intermix switches and values
    – Serge
    Sep 30, 2012 at 1:02
  • @Kanvuanza aha, I see now)
    – Serge
    Sep 30, 2012 at 1:35

1 Answer 1

9

GPG's command-line parsing is a bit odd:

gpg [--homedir dir] [--options file] [options] command [args]

The correct order is options, then the command, then the command's arguments, so you should do:

gpg --keyserver 'hkp://keyserver.ubuntu.com:11371' --send-keys <keyID>

It looks like GPG will let you get away with putting the command before the options, so you can also do:

gpg --send-keys --keyserver 'hkp://keyserver.ubuntu.com:11371' <keyID>

But the command's arguments (in this case, <keyID>) must be last. From the man page:

Please remember that option as well as command parsing stops as soon as a non-option is encountered,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .