Adding A User To An Existing GPG key
I recently came across an issue when I was signing commits that also used my business email.
![]()
I gladly learned that it’s not very hard to add an additional user id to a GPG key.
Get Current Secret Key ID
To start, we need to get our current secret key id. We’re looking for the sec{:plain} key.
We can ignore the bit length
gpg --list-secret-keys --keyid-format LONG
#=> ~/.gnupg/secring.gpg
#=> ------------------------------------------
#=> sec 4096R/THISISMYKEY 2016-11-04
#=> uid Fernando Paredes <[email protected]>
#=> ssb 4096R/THISISMYSSB 2016-11-04
Edit Key
gpg --edit-key THISISMYKEY
--edit-key{:sh} will drop us into gpg{:sh}’s REPL. From here we can add our additional user ID:
gpg> adduid
#=> Real Name: Newt Scamander
#=> Email address: [email protected]
#=> Comment: Fantastic Beasts
#=> Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
Github
We’ll need to add our key to Github. If you’ve already added the key to Github, you’ll need to delete it and paste in your new key.
gpg --armor --export | pbcopy No comments yet. Share on Mastodon and see your comment or write a post on your blog if you support Webmentions
No reposts yet. Share on Mastodon and see your repost or write a post on your blog if you support Webmentions
No likes yet. Share on Mastodon and see your like or write a post on your blog if you support Webmentions
No bookmarks yet. Share on Mastodon and see your bookmark or write a post on your blog if you support Webmentions
Powered by Webmentions