Skip to content
Discussion options

You must be logged in to vote

Experimented on this a bit, and basically, yes, revoke the key and re-add it to GitHub.

Ideally, you should add an expiry date to your keys when they are being created, but let's say your keys do not expire, and you want to revoke them. GitHub does recommend not setting an expiration date for your keys; see https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key . Let's say you suddenly want to revoke a GitHub GPG key.

Here are the steps:

  1. List keys & find your key

gpg --list-keys --keyid-format=long / gpg --list-secret-keys --keyid-format=long

  1. Note your key ID; this value will replace KEYID in upcoming steps

See, for example:

pub   …

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@loicalbertin
Comment options

@Vectorial1024
Comment options

@ReenigneArcher
Comment options

@Vectorial1024
Comment options

Answer selected by Vectorial1024
Comment options

You must be logged in to vote
1 reply
@frankpengau
Comment options

Comment options

You must be logged in to vote
1 reply
@SwuduSusuwu
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Security Build security into your GitHub workflow with features to keep your codebase secure Question Ask and answer questions about GitHub features and usage
6 participants