[英]Git for Windows error Permission denied (publickey)
OS - Windows 7. 操作系统-Windows 7。
I installed Source Tree, and I have account on Bitbucket. 我安装了Source Tree,并且在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. 我在源代码树中生成了SSH密钥,在
.ssh
文件夹test_private.ppk
公用密钥保存为test.pub
,将私用密钥保存为test.pub
,并在Pageant中添加了私钥。
Also I copied ssh key and saved it in Bitbucket settings. 我也复制了ssh密钥并将其保存在Bitbucket设置中。
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)
当我使用Source Tree界面时,提交和推送工作正常,但是当我尝试使用控制台时,出现错误
Permission denied (publickey)
What's the problem? 有什么问题?
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. 您需要使用-i切换到ssh或使用ssh_config告诉ssh在哪里可以找到您的密钥,因此即使git也会知道它们。
ssh -i test_private.ppk -T git@bitbucket.org
should work work for you. 应该为您工作。 Adding the line
添加线
IdentityFile test_private.ppk
to your ssh_config
should solve the issue for both cases. ssh_config
可以解决这两种情况的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.