I’m trying to use these tools in conjunction:
- Powershell 5 on Windows 10
- Git version 2.13.0.windows.1
- Keepass 2.35 with the KeeAgent plugin to fire up Pageant
- Putty 0.69
- I also have SourceTree version 188.8.131.52 installed
I’ve generated a public/private key pair, loaded the public key in GitLab, GitHub, Bitbucket, and other places. I’ve loaded the private key in Pageant via KeeAgent successfully and I can see the fingerprint is correct.
Now, if I try to do
git pull from Powershell I get this:
12345 Permission denied (publickey).fatal: could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
However, if I place
id_rsa (an OpenSssh file generated with Putty) in my user’s
.ssh folder then
git pull works, but it will ask for the passphrase *every time*.
Now if I use SourceTree I can pull changes just fine! So what was the problem?
Apparently, this solution by user @CTS_AE works just fine: you have to add a System Environment Variable called “GIT_SSH” that points to “plink.exe”. For me:
Restart your Powershell session and voila: pulling in changes from the command line works again!
Footnote: If you get stuck at “Store key in cache? (y/n)” with no input from the keyboard being registered then this solution by @cambunctious might work. Just open Putty, try to SSH into
bitbucket.org, and use the GUI to add the fingerprint. Silly, stupid, but it works.