How to change the gpg key associated with your pass / password store

Today I wanted to change the gpg key that is used for encrypting and decrypting my passwords in Unix’s password store .

A quick look at the man page for pass taught me that all I have to do is:

BASH
pass init "new-GPG-key-id"
Click to expand and view more

From the man page (first part):

BASH
 init [ --path=sub-folder, -p sub-folder ] gpg-id...
              Initialize new password storage and use gpg-id for encryption. Multiple gpg-ids may be specified, in order to encrypt each password with multiple ids. This  command  must  be run  first  before  a password store can be used.
Click to expand and view more

And then it continues:

BASH
If the specified gpg-id is different from the key used in any existing files, these files will be reencrypted to use the new id.
Click to expand and view more

And so on.

So, there you have it. Just re-initaliase the password store with your new key ID(s), and you’re good to go.

If you are rusty with GPG, your can find your gpg key ID by entering the following command:

BASH
gpg --list-keys
Click to expand and view more

I hope this helps!

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut