Skip to content

Instantly share code, notes, and snippets.

@jmtsantos
Last active May 22, 2021 15:10
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 jmtsantos/0e417bfeba485dac34d6f067612d40c7 to your computer and use it in GitHub Desktop.
Save jmtsantos/0e417bfeba485dac34d6f067612d40c7 to your computer and use it in GitHub Desktop.
migrate all you password-store passwords and secrets to another GPG key
#!/bin/bash
KEYID=<KEY ID FOR YOUR NEW ENCRYPTING KEY>
cd ~/.password-store
for f in $(find . -name '*.gpg'); do
oldpass=$(gpg -d $f)
echo $oldpass | gpg -r $KEYID -e > $f
chmod 600 $f
done
for f in $(find . -type d); do
chmod 700 $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment