Skip to content

Commit 72ac4f2

Browse files
committed
Add an example of mass re-keying
1 parent f7164c8 commit 72ac4f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

content/til/2017-10-05-a-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,10 @@ Select `2 - unblock PIN` and follow the instructions.
634634
websites like GitHub and Keybase as they don't appear to update
635635
automatically via public PGP key servers.
636636
637-
1. Re-key any encrypted files with the new subkey.
637+
1. Re-key any encrypted files with the new subkey. Example:
638+
``` bash
639+
$ for f in $(find . -name '*.gpg'); do gpg2 --batch --decrypt $f | gpg2 --encrypt -r MASTER_KEY_ID --armor --output tempfile.gpg && mv tempfile.gpg $f; done
640+
```
638641
639642
1. Verify your work.
640643

0 commit comments

Comments
 (0)