8

I have read the GitHub questions here rather thoroughly, but couldn't find the clue to my problem. I have created new git repo and now I'm trying to push it to GitHub:

git remote add origin git@github.com:clergyman/first_app.git
git push origin master

I get:

FATAL ERROR: Disconnected: No supported authentication methods available
fatal: The remote end hung up unexpectedly

ssh git@github.com works fine.
I'm running on 32 bits windows 7.
GitHub global settings are fine too. Any ideas?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Clergyman
  • 281
  • 1
  • 3
  • 13
  • 1
    Surprisingly I found the solution, so I'll put it here. The whole problem is because when trying to establish connection via SSH (>git push origin master), git was trying to use PUTTY, and when >ssh git@github.com it uses ssh client that goes with git install package. So to me the following helped: I reinstalled git, and when the wizard asked what ssh client to use, I checked OpenSSH this time! So, putty appeared the root of all evil. Good luck to everyone. – Clergyman Jul 20 '11 at 08:42
  • 1
    Use the HTTPS to push. It is easier that way. – J-16 SDiZ Aug 07 '11 at 11:48

6 Answers6

7

I ran into the same error message trying to get Git, Git Extensions, and GitHub working with 64-bit Windows 7. I was able to solve the problem while continuing to use Putty.

I created a .profile file in C:\Users\MyUserName with the following contents:

GIT_SSH="/c/Program Files (x86)/Git/bin/ssh.exe"

Had to use "touch .profile" within git bash to create the file since Windows GUI chastises you for trying to create files starting with period.

Can't take credit. I just put a windows spin on the answer provided here.

Community
  • 1
  • 1
kemida
  • 301
  • 2
  • 3
  • I guess this is a variation of the same solution- specifying the path to default ssh client for git. – Clergyman Aug 07 '11 at 11:42
  • This worked for me. Only thing is path may vary depending 32/64 bit version of git client in my case `GIT_SSH="/c/Program Files/Git/usr/bin/ssh.exe` – Kundan Jan 17 '20 at 07:03
7

When I choose plink.exe to perform the authentication, Here are my steps

  1. use "puttygen.exe" to generate the public and private keys and save the private key in putty private key file format( filename.ppk ).
  2. Paste the public key generated in "puttygen.exe" into github account setting.
  3. Launch pageant.exe (Putty Authentication Agent) , and add the private key generated in step 1.
Mr. HA
  • 71
  • 1
  • 1
6

The solution is somehow change default ssh client for git from pegeant to openSsh. E.g. reinstall git and check openSSH in the corresponding window (not pegeant or something), if you have just installed git and haven't started to work woth it yet.

Clergyman
  • 281
  • 1
  • 3
  • 13
2

Could the section "No supported authentication methods available" on GitHub help at all?

You should be aware of the environment variable GIT_SSH, which is used by git to find your ssh-speaking client, if ssh doesn’t work for you.
The git install may be using plink.exe (via GIT_SSH) to perform the authentication.
If so, make sure you have pageant.exe running, and the key you created for github loaded into it. This provides the key to plink.exe; without it, the above error will occur.

See this post for a longer discussion.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks, it wasn't about environment variables or something, it was about weirdness of putty. I changed pegeant to OpenSSH as default ssh client and it started working properly. – Clergyman Jul 20 '11 at 08:38
  • To me this is too complex, solving this problem with putty you cause another, and so on. Why should I make git work with some other client if there is familiar one in the package and ready to work, I mean openSSH? – Clergyman Aug 07 '11 at 11:52
0

My co-worker have this error crop up on him today using TortoiseGit. He had inadvertently moved his Putty Private Key file (myprivatekey.ppk) into a different folder. So ensure the path to your private key file is correct. In TortoiseGit, go to Settings...Git...Remote. See the screenshot below:

enter image description here

James Lawruk
  • 30,112
  • 19
  • 130
  • 137
0

Have you properly set up your ssh keys on github?

You need to create a ssh key, and put your public key on github. The two top references are

http://help.github.com/mac-set-up-git/

and

http://help.github.com/ssh-issues/

jkeesh
  • 3,289
  • 3
  • 29
  • 42