Last active
May 22, 2021 15:10
-
-
Save jmtsantos/0e417bfeba485dac34d6f067612d40c7 to your computer and use it in GitHub Desktop.
migrate all you password-store passwords and secrets to another GPG key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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