github: No supported authentication methods available

Viewed 114494

i use github and have successfully added and synched files on my laptop in the past.

as of recent i started getting "PuTTY Fatal Error: Disconnected: No supported authentication methods available" after running:

git pull origin master (or push)

however

ssh git@github.com returns the correct response: ERROR: Hi username! You've successfully authenticated, but GitHub does not provide shell access Connection to github.com closed.

after digging around on github i found this morcel:

No supported authentication methods available 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.

not sure what plink.exe or peagant.exe is.. and the fact that ssh git@github.com seems to authenticate correctly makes me wonder what the best solution here is.. i certainly don't want to overcomplicate my setup if not necessary.

18 Answers

My issue was that I was attempting to use my github username. Apparently when using Github (or is it a Git thing?), if you use key-based authentication, you need to set your username to git.

I'm not sure why you even need a username at all - perhaps someone more knowledgeable can explain that?

Worked for me on Windows 8: GIT_SSH variable was pointing to plink.exe, Changed it in the system settings to point to the ssh binary, and that has fixed the problem. To find out full path to the ssh, run:

where ssh

To resolve this issue this was what I did.

I was using Git Bash on Windows 10

I started Pageant, pressed Add Key,

enter image description here

navigated to C:\Users\username\.ssh folder and chose my key

enter image description here

I then attempt to do a git push and it worked this time.

I had a similar issue after updating GitExtensions to version 3.3.0.7719

Somehow it reverted my authentication settings to use PuTTY instead of OpenSSH.

In that version here is the menu I used to enable OpenSSH again:

enter image description here

I just solved the exact same issue by setting GIT_SSH env var to ssh. Just these 3 letters.

I strongly discourage Windows 10 users to set GIT_SSH to anything else than just ssh string (no extension), to maximise cross operability between Windows Terminal, git bash, cmd, and even PHP Storm. Obviously, your %PATH% will have to have ssh.exe in its way.

I recommend you install Git for Windows, and you add C:\Program Files\Git\usr\bin down your %PATH%

If you ever reinstall Git for Windows, be ready to set it again, and the install will ask you to specify a "plink". Little does it know that "ssh" will work to. That installer will anyway refuse anything else than an absolute path.

May I dare reminding that you obivously should restart your console or IDE after changing GIT_SSH value and/or your path.

This answer relates to solving this issue: "Cannot spawn ssh" when connecting to Github, but ssh -T git@github.com works?

In Windows 10, if you did a typical installation including Putty, none of the above solutions worked for me, I had to go into the control panel and specifically the system variables, changing GIT_SSH to D:\Program Files\Git\usr\bin\ssh.exe there (it was linking to plink.exe and no amount of modifying .profile or whatever convinced it to change that, only editing the system variables).

Related