(1)OS:Win7 32Bit. git
(2)Git:GitHub for Windows 2.0. github
下載地址:https://windows.github.com/ web
(3)Command Shell:Git Shell. windows
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:
|
F:\Workspaces\Github_Workspace>
ssh -T git@github.com
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. |