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.
If you're using Pageant and are getting the error described in the question after rebooting your PC (or otherwise closing and reopening Pageant):
The error can be caused by Pageant not having your GitHub SSH key actively loaded. By default, Pageant does NOT automatically load the keys from the previous session when it starts up.
To load the key:
To avoid this problem in the future, you can configure Pageant to automatically load your key when it starts up. (Pageant will automatically prompt you for a password if your key is password-protected.)
Steps to do this (assuming you already have Pageant configured to run when Windows starts):
shell:startup
)Reference and full details: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html
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?
Since you ask: plink & pageant are part of the PuTTY suite, which is an implementation of SSH that supports Linux & Windows and is completely dominant on Windows.
SSH
if you ever used Telnet, it's like that (but more secure): it allows you to remotely access the bash shell (command line) of a Linux host.
PuTTY
On Windows it's the dominant software for remotely accessing a Linux host's command line under the SSH protocol (above). In Windows, .exe extensions are for executables. So those notes about plink.exe & pageant.exe probably don't apply if you're in Linux. PuTTY includes
From (http://en.wikipedia.org/wiki/Secure_Shell#Key_management)
So github is hosted on a Linux machine and uses SSH to secure the connection. SSH either authenticates with passwords or keys, many hosts (github?) only authenticate with keys. You setup is apparently trying to authenticate with a key. Keys and hosts are not one-for-one: you can have two keys for the same host and/or two hosts for the same key, so they need to be managed. If you are in Windows, then your SSH session is probably accessed through plink and your keys are probably managed by Pageant.
Import the key you need each time you load Pageant. If you followed guides that said "import your key", and saw that it worked, but it doesn't work now, see Chapter 9: Using Pageant for authentication.
One last tip if you are on Windows: you may have multiple instances of the PuTTY suite installed by various tools. TortoiseGit, for example, installs its own.
I experienced this problem because my
GIT_SSH
was pointing to the TortoiseSVN version ofPlink.exe
. I changed it to point to the TortoiseGit version, restarted cmd and it worked.I can't remember exactly, but the TortoiseSVN version might have been 32-bit version, and the TortoiseGit version was 64-bit (located in
Program Files
, notProgram Files (x86)
).Double-check your
GIT_SSH
env var.I prefer to use git with normal
cmd.exe
(in Console2 of course)I encountered this same problem, however the GIT_SSH solution appeared to work once for me. After a computer restart I realized it was something else, as I was able to clone my private repositories with no problem using Git Bash or Command Prompt, but not in Sublime Text 3 with the SublimeGit plugin. My solution was simple and is actually what @BlueRaja - Danny Pflughoeft mentioned but I thought it could use some direction ;)
Basically you just need to edit
~/.ssh/config
and ensure the username isgit
. You can also tell it to use a specific SSH key for Github -- My~/.ssh/config
file looks like the following:I have a specific key for Github due to the number of other things I do throughout my day, but if you've only got one then it usually will be
~/.ssh/id_rsa.pub
like Github explains here.I know everyone has a different solution, but I'll leave this here for anyone who may encounter this article without a fix. Good luck!
I got this problem (direct ssh worked, but git pull failed) due to my git remote not being what I thought it was.
Yes, yes, I know it's a stupid mistake, but it happens and it's worth checking.
Use
git remote -v