在Win7上安装git后，用ssh -T firstname.lastname@example.org 测试，报错：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 (22.214.171.124)' 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 "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.