Change pass gpg key

Posted on by Zach Oglesby
Tags: fedora

I use pass as a password manager for a lot of reasons. One, it uses GPG to secure passwords, and two because it uses git for backups. When I started to use the tool I created a second GPG key that I was just using for pass, but as time went on I no longer liked that idea and wanted to move it back to my primary key to take advantage of my yubikey. The issue was that for the life of me I could not figure out how to do this.

It turns out that it is very simple. Just use

pass init $NEW_KEY_ID

After that pass will re-encrypt all of your passwords with the new key. Two git commits later and all of your passwords are now using the new key.