Search code examples
gnupg

Network Unreachable when uploading gpg public key


I'm trying to upload my gpg public key in order to deploy releases of my Maven artifacts to Maven Central. But when I run the following command:

gpg --keyserver keyserver.ubuntu.com --send-keys E655AF47

I get the following error:

gpg: sending key E655AF47 to hkp://keyserver.ubuntu.com
gpg: keyserver send failed: Network is unreachable
gpg: keyserver send failed: Network is unreachable

I am using gpg (GnuPG) 2.3.6 on MacBook.

Where am I going wrong here?


Solution

  • Looks like these servers not permit such mechanism anymore...

    First, try to specify https protocol explicitly:

    gpg --keyserver https://keyserver.ubuntu.com --send-keys E655AF47
    

    If that is also not working, then you must upload it manually:

    1. copy your public key:
    gpg --armor --output public-key.gpg --export your@email.com
    cat public-key.gpg | pbcopy
    

    where your@email.com you can find with gpg --list-signatures command

    1. go to https://keyserver.ubuntu.com/
    2. Click Submit Key button
    3. Paste your public key you've copied in 1st step with pbcopy command and submit it
    4. Verify your submission like so:

    https://keyserver.ubuntu.com/pks/lookup?search=0D6866D45122F4B762BBA078CA756566F2B91BC1&fingerprint=on&op=index

    where 0D6866D45122F4B762BBA078CA756566F2B91BC1 your keyid, which you can also find with gpg --list-signatures command