Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
Last active June 12, 2023 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbrisbin/074d6e406bd1089bfac1afb93b9c1656 to your computer and use it in GitHub Desktop.
Save pbrisbin/074d6e406bd1089bfac1afb93b9c1656 to your computer and use it in GitHub Desktop.
Refreshing GPG keys

These are my own notes for my re-expiration of GPG keys.

1- Mount flashdrive

sudo cryptsetup open /dev/sdb1 --type=tcrypt flashdrive
sudo mkdir -p /mnt/flashdrive
sudo mount /dev/mapper/flashdrive /mnt/flashdrive
export GNUPGHOME=/mnt/flashdrive/gnupg

2- Edit and re-expire

gpg --edit-key 7A4F38C201F43F111C95A9E575481C55CEC8925D
gpg> expire

Choose 1y, save and exit.

3- Send

gpg send-keys --keyserver hkp://pgp.surf.nl

4- Receive

Wait a minute, then in another terminal (normal GNUPGHOME) run:

gpg refresh-keys --keyserver hkp://pgp.surf.nl

Sometimes you have to send/recv specific keys. It'll work eventually.

5- Publish

  • Push to S3
  • Delete, re-add in GitHub: gpg -a --export pbrisbin@gmail.com | xclip -selection clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment