Win7 Git Permission denied (publickey)

在Win7上安装git后,用ssh -T git@github.com 测试,报错:Permission denied (publickey),谷歌了很多文章,有说着说那的,感觉都不是很靠谱,最后发现了这个答案:

Using Windows 8 to setup your ssh and Github

If it says "Permission denied (publickey)" you will have to put in a passphrase for your key. Do not be tempted to just press enter...this was what worked for me...it took me five hours to realize that pressing enter made OpenSSH feel that your key was too public so that is why it is denying you from going to the next step.
If it says "The authenticity of host 'github.com (203.232.175.90)' can't be established." Then you will have to go through the process shown here: [Google] (https://help.github.com/articles/error-permission-denied-publickey.)
Go to the part that says "Verify the public key is attached to your GitHub account". You want to start with the part that says account. (I am assuming you already have an account.

Also, you want to be in C:\RailsInstaller\Git.ssh and when I did 'dir' I noticed that I had '.', '..', 'known_hosts'. I had to get a new key by doing the following (I found this on the Github site):

"ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. < # Enter file in which to save the key(/c/Users/you/.ssh/id_rsa): [Press enter]"
And pay attention to the file where the key will be saved. Do not just press enter.. my one showed "(//.ssh/id_rsa)" I had to type "/.ssh/id_rsa" to make sure it was in the right directory.

And you should be able to type ssh in the command line. If you cannot do that you will have to add it to your path.


按照上面的方法解决了问题,如下结果:




原文链接:http://stackoverflow.com/questions/2127104/permission-denied-publickey-error-using-git-on-windows-7

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值