Git for Windows错误权限被拒绝(publickey)

时间:2016-01-15 20:00:10

标签: git ssh

操作系统 - Windows 7.
我安装了Source Tree,我在Bitbucket上有账号 我在源代码树中生成了SSH密钥,在test.pub文件夹中将公钥保存为test_private.ppk,将私钥保存为.ssh,并在Pageant中添加了私钥。 我也复制了ssh键并将其保存在Bitbucket设置中 当我使用Source Tree接口时,提交和推送工作正常但当我尝试使用控制台时,我收到错误Permission denied (publickey)

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

enter image description here

有什么问题?

UPD enter image description here enter image description here

1 个答案:

答案 0 :(得分:1)

你需要告诉ssh在哪里找到你的密钥使用-i切换到ssh或者更确切地说使用ssh_config,所以即使git也会知道它们。

ssh -i test_private.ppk -T git@bitbucket.org

应该为你工作。添加行

IdentityFile test_private.ppk

ssh_config应解决两个案例的问题。