Heidel
Heidel

Reputation: 3254

Git for Windows error Permission denied (publickey)

OS - Windows 7.
I installed Source Tree, and I have account on Bitbucket.
I generated SSH key in Source Tree, saved public key as test.pub and private key as test_private.ppk in .ssh folder, and added private key in Pageant.
Also I copied ssh key and saved it in Bitbucket settings.
When I use Source Tree interface, commits and pushes work just fine but when I try to use console, I get an error Permission denied (publickey)

введите сюда описание изображения

enter image description here

What's the problem?

UPD enter image description here enter image description here

Upvotes: 0

Views: 1307

Answers (1)

Jakuje
Jakuje

Reputation: 25926

You need to tell ssh where to find your keys using -i switch to ssh or rather using ssh_config so even git will know them.

ssh -i test_private.ppk -T [email protected]

should work work for you. Adding the line

IdentityFile test_private.ppk

to your ssh_config should solve the issue for both cases.

Upvotes: 1

Related Questions