地址01: http://space.itpub.net/25851087
地址02: http://www.cnblogs.com/zjrodger/
作者名:zjrodger
(1)OS:Win7 32Bit.
(2)Git:GitHub for Windows 2.0.
下载地址:https://windows.github.com/
(3)Command Shell:Git Shell.
|
F:\Workspaces\Github_Workspace> ssh -T git@github.com
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of know n hosts. Permission denied (publickey). |
|
Host github.com
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
IdentityFile=~/.ssh/github_rsa
|
| Host * StrictHostKeyChecking no UserKnownHostsFile=/dev/null Host github.com StrictHostKeyChecking no UserKnownHostsFile=/dev/null IdentityFile=~/.ssh/github_rsa |
方法三:
|
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. |
|
So as mentioned in prior answers, the
Permission denied
error in Windows is because you are trying to use a key other than
id_rsa
.
Windows lacks the bells and whistles that Linux and Mac have to try out all your public keys when trying to connect to a server via SSH. If you're using the ssh
command, you can tell it which key to use by passing the
-i
flag followed by the path to the key to use:
|
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of know
n hosts.
Permission denied (publickey).
F:\Workspaces\Github_Workspace> ssh -i ~/.ssh/id_rsa git@github.com
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of know
n hosts.
Enter passphrase for key '/c/Users/Administrator/.ssh/id_rsa':
Hi zjrodger! You've successfully authenticated, but GitHub does not provide shel
l access.
Connection to github.com closed.
本文详细阐述了在使用GitHub for Windows 2.0安装于Windows 7系统后,遇到的SSH连接权限被拒绝的问题,并分析了问题产生的原因在于SSH配置文件中的IdentityFile项与实际生成的密钥路径不匹配。文章提供了三种解决方案以解决此问题,包括修改SSH配置文件中的IdentityFile项、重命名生成的密钥文件或重新安装GitHub for Windows以使用默认配置。同时,文章指出避免手动修改SSH配置文件的重要性。
5万+

被折叠的 条评论
为什么被折叠?



