Http://www.douban.com/note/201614252/
Ssh, permission denied (publickey) on GitHub) 2012-02-20 19:30:00 In short, this problem often occurs in Linux.
The following is a command my sister tried. You can use it one by one. This is a great deal ~~~
First, let's see if you can use it:
Ssh-T git@github.com
If you can:
Hi your_name... success... but no shell access (forgot)
Otherwise, you may not have RSA key pair. Generate first. Remember to generate to the root directory :~ /. SSH
Ssh-keygen
Then, if you ask about anything, enter will be default to root.
Then, load the id_rsa.pub file to your GitHub account: account settings ---> SSH ---> Add new SSH key.
Remember Copy & Paste. Do not change anything!
Now it should be okay, but sometimes .....
If the problem persists, try:
$ Chmod 700 ~ /. SSH
$ Chmod 600 ~ /. Ssh /*
If the problem persists, create a config file in the SSH directory. If so, add the lines directly:
Host github.com
User git
Hostname github.com
Preferredauthentications publickey
Identityfile [local path to private key half of GitHub Public Key you provided]
I encountered a strange syntx error, and I didn't use the last line. It's okay to use clone command. I don't know what this identityfilei is... all in all. I'm bored!