Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use pass with git on multiple computers

I've recently come across this seemingly nice pass manager This manager allows passwords encryption using your gpg key and saving passwords in a git repository. I'm a bit new to git so this is also some fun for me.

One thing I don't get is the elegant way to access the same git rep from multiple computers to use pass. GPG key is required to start using pass and to create the local rep. Next when I try fetching from the remote rep, I obviously get a conflict because the gpg key on PC 2 is not the one used on PC 1 (that is in the rep). When you try solving a conflict by removing the key in your local rep on PC 2 hoping to fetch the original one from the remote rep - pass fails to work without the key. So how do I get pass both PC 1 and PC 2 share the same gpg key so pass could work smoothly?

Do I try to make it do something it is not supposed to do? Otherwise I don't see any advantages of using a remote git rep for passwords.

Thanks!

like image 338
Mike K Avatar asked Sep 19 '25 12:09

Mike K


1 Answers

You need to copy your GPG private key to each of your trusted machines. The best way to do this (presuming of course that your keys are passphrase protected) is to export them from the machine they were created on, copy the file over, and import them on the other machine.

You'll need to know the ID of the key you want to export:

gpg --list-keys

Now figure out which private key you need and replace it below:

gpg --export-secret-key <PRIVATE_KEY_ID> > private.key

Now transport the private.key file to the other machine and import it:

gpg --import private.key
like image 133
Caleb Avatar answered Sep 21 '25 09:09

Caleb