Skip to content

Instantly share code, notes, and snippets.

@benlemasurier
Forked from krisleech/renew-gpgkey.md
Last active October 11, 2022 15:09
Show Gist options
  • Save benlemasurier/9afcff970766151a25a074a8276f6016 to your computer and use it in GitHub Desktop.
Save benlemasurier/9afcff970766151a25a074a8276f6016 to your computer and use it in GitHub Desktop.
Renew Expired GPG key

Renew GPG key

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

gpg> expire

When prompted type 1y or however long you want the key to last for.

Select all the subkeys (the primary key, which we just set the expires date for, is key 0):

gpg> key 1
gpg> key 2
gpg> expire

A star will sppear before all selected keys.

gpg> trust
gpg> save
gpg -a --export KEYID > kris.leech.gpg.public
gpg -a --export-secret-keys KEYID > kris.leech.gpg.private

Publish the public key:

gpg --keyserver keyserver.ubuntu.com --send-keys KEYID
gpg --keyserver pgp.mit.edu --send-keys KEYID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment