Closed uioporqwerty closed 5 years ago
Well, I do't know how you have extracted the private key, but at least that's not the correct way to import it back in secring : --import would only import a public key, if you want to import the private key part, you need : gpg --allow-secret-key-import --import private.key
So on PC A I ran the following commands to export the public and secret keys.
gpg --export -a 40CD5608 > public.asc
gpg --export-secret-keys -a 40CD5608 > secret.asc
which I then transfer both files to PC B and then run the command previously to import the private key gpg --import private.asc
.
I deleted the keys with gpg --delete-secret-key 40CD5608
and gpg --delete-key 40CD5608
which cleared out my keyring. But after running gpg --allow-secret-key-import --import secret.asc
the git-crypt command still returns the error above.
Running gpg --list-secret-keys
and gpg --list-keys
returns the correct information for the email address I'm using for the GPG.
My collaborator list:
Author: uioporqwerty <nitish.sachar@protonmail.com>
Date: Mon Nov 20 22:13:07 2017 -0800
Add 1 git-crypt collaborator
New collaborators:
40CD5608 Nitish Sachar <nitish.sachar@protonmail.com>
Response from gpg --list-secret-keys
/home/nsachar/.gnupg/secring.gpg
--------------------------------
sec 4096R/40CD5608 2017-10-31
uid Nitish Sachar <nitish.sachar@protonmail.com>
ssb 4096R/7359C7C7 2017-10-31
Reponse from gpg --list-keys
/home/nsachar/.gnupg/pubring.gpg
--------------------------------
pub 4096R/40CD5608 2017-10-31
uid Nitish Sachar <nitish.sachar@protonmail.com>
sub 4096R/7359C7C7 2017-10-31
Nevermind, guess it is resolved now.
@uioporqwerty Should probably close this if it is resolved :+1:
I have the same problem. How did you resolve it @uioporqwerty ?
Oh I find what's wrong. I use ssh over pip to import key as this:
gpg --export-secret-keys wenxuangm@gmail.com | ssh <remote> gpg --allow-secret-key-import --import
There is no error message. But actually --allow-secret-key-import
option does not take effect.
When I copy the key and run gpg --allow-secret-key-import --import secret.asc
on the new machine, the secret key was successfully imported. And git-crypt unlock
does not complain anymore.
I'm trying to unlock a repository on another computer. From PC A I exported the private key as
private.asc
and then I import it on PC B usinggpg --import private.asc
. However when I rungit-crypt unlock
I get the following error:Why does this happen? I'm using Windows 7 and MSYS2 64 bit terminal.