Github: No authentication methods available

I use github and have successfully added and synchronized files on my laptop in the past.

recently, I started getting " PuTTY Fatal Error: Disconnected: No Authentication Methods Available " after starting:

git traction creation wizard (or click)

However

ssh git @ github.com returns the correct answer: ERROR: Hello, username! You have successfully authenticated, but GitHub does not provide shell access. The connection to github.com is closed.

after digging in github i found this morcel:

There are no authentication methods available. You must know the GIT_SSH environment variable that git uses to find your ssh-speaking client if ssh does not work for you. Installing git can use plink.exe (via GIT_SSH) to perform authentication. If so, make sure you have the pageant.exe file running and the key you created for the downloaded github. This gives the key to plink.exe; without it, the error above will occur.

not sure what plink.exe or peagant.exe .. and the fact that ssh git @ github.com seems to authenticate correctly makes me wonder what the best solution is here ... I certainly don't want to it is not necessary, reinstall my setting.

+94
git msysgit github ssh
Aug 07 '10 at 17:11
source share
14 answers

You can create a file called .profile in your home directory, for me it is C: \ Users \ [user]

Inside this file, place the following line of code:

GIT_SSH="/usr/bin/ssh.exe" 

This will set the GIT_SSH environment variable to use the ssh client included in git.

The .profile script file is run when the Git Bash command line is launched.

Edit: This is my .profile. It will ask you for the password the first time you run the Git command line, and then remember it until you restart your computer. Very convenient, so you do not need to enter a password every time you want to do something.

 SSH_ENV="$HOME/.ssh/environment" GIT_SSH="/usr/bin/ssh.exe" function start_agent { echo "Initializing new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add; } # Source SSH settings, if applicable if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null #ps ${SSH_AGENT_PID} doesn't work under cygwin ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi 
+93
Oct. 01 2018-10-10
source share

Using TortoiseGit

TortoiseGit> Settings ... Network ... SSH Client: C:\Program Files\Git\usr\bin\ssh.exe

The place is changing me. On one computer, it was in C:\Program Files (x86)\Git\bin\ssh.exe

tortoisegit

+25
Aug 03 '15 at 14:44
source share

"... I do not know what plink.exe or peagant.exe is ..."

As you ask: plink and stant are part of the PuTTY package, which is an SSH implementation that supports Linux and Windows and completely dominates Windows.

Ssh

Secure Shell (SSH) is a cryptographic network protocol for securing data transfer. It establishes a secure channel over an insecure network in a client-server architecture that connects an SSH client application to an SSH server. Common applications are remote command line input, remote command execution, but any network service can be protected by SSH.

if you've ever used Telnet, it is (but more secure): it allows you to remotely access the Linux host bash command line.

PuTTY

PuTTY is a free, open source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin ...

On Windows, it is the dominant Linux host command-line access control software via SSH (see above). On Windows, .exe extensions are for executable files. Therefore, these notes about plink.exe and pageant.exe probably do not apply if you are on Linux . PuTTY includes

Plink : command line interface for PuTTY loops

Pageant : SSH Authentication Agent for PuTTY, PSCP, and Plink

From ( http://en.wikipedia.org/wiki/Secure_Shell#Key_management )

When the public key is present at the remote end and the corresponding private key is present at the local end, having typed the password, no longer is required ... for added security, the secret key itself can be locked using phrases.

So github is hosted on a Linux machine and uses SSH to secure the connection. SSH is either authenticated using passwords or keys, many hosts (github?) Are only authenticated using keys. You seem to be trying to authenticate with a key. Keys and hosts are not the same for one: you can have two keys for the same host and / or two hosts for the same key, so you need to manage it. If you are on Windows, your SSH session will probably be accessible via plink, and your keys will probably be managed using Pageant.

Import the required key when loading Pageant. If you follow the instructions that said โ€œimport your keyโ€ and saw that it worked, but now it doesnโ€™t work, see Chapter 9: Using Pageant for Authentication .

A final tip if you are on Windows: you may have multiple instances of the PuTTY suite installed by various tools. For example, TortoiseGit installs its own.

+10
Mar 13 '15 at 15:21
source share

I had this problem because my GIT_SSH pointing to the version of TortoiseSVN Plink.exe . I changed it to point to the version of TortoiseGit, restarted cmd and worked.

I donโ€™t remember exactly, but the version of TortoiseSVN could be a 32-bit version, and the version of TortoiseGit was 64-bit (found in Program Files , not Program Files (x86) ).

Double check your GIT_SSH env var.

I prefer to use git with regular cmd.exe (of course, in Console2)

+8
Oct 11
source share

For TortoiseGit users on Windows

I originally used to configure most of my Github / Bitbucket repositories using the URLs of the SSH repository , because (originally) it was used to be the only convenient way to prevent TortoiseGit from asking for your password for every one action.

But installing TortoiseGit in this way has always been painful. Every time it took me a few hours to configure correctly, since the default installation options never worked (even as of 2016, sheesh!).

But TortoiseGit now has better password management for HTTPS, and Github actually recommends using HTTPS URLs where possible.

SSH git@github.com:User/repo-name.git

Https url: https://github.com/User/repo-name.git

HTTPS Benefits:

  • There is no SSH management or key generation.
  • No need to constantly run pageant.exe (which asks for your password every time you start)
  • Using TortoiseGit from Australia, I found that clones over HTTPS are 5-10 times faster than SSH
+6
Jun 20 '16 at 8:32
source share

If you use Pageant and get the error described in the question after rebooting your PC (or closing and reopening Pageant):

The error can be caused by the fact that your SSH GitHub active key is not active. By default, Pageant does not automatically load keys from a previous session at startup.

To download a key:

  • Open Page. (On Windows, if Pageant is running, an icon will appear in the system tray. Double-click this.)
  • Click the Add Key button and proceed with adding the existing SSH GitHub key.

To avoid this problem in the future, you can configure Pageant to automatically download your key when it starts. (Pageant automatically asks for a password if your key is password protected.)

The steps for this (assuming you already have a Pager that starts when Windows starts):

  • Find the shortcut used by Windows to start Pageant when Windows starts. (This can be in the startup folder, which can be opened by Start> Run> shell:startup )
  • In the Shortcut Properties dialog box, add the full path and file name of the SSH key in the Target field.

Link and full information: http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html

+5
Jun 15 '16 at 2:51 on
source share

My problem was that I was trying to use my github username. Apparently when using Github (or is it a Git thing?), If you are using key based authentication, you need to provide your git username.

I'm not sure why you need a username at all - maybe someone more knowledgeable can explain this?

+4
Nov 05 '13 at 17:15
source share

On my Windows 7 computer running Github for Windows using git version 1.8.3.msysgit.0. I found that updating my GIT_SSH system environment variable to C: \ Program Files (x86) \ Git \ bin \ ssh.exe seemed like a trick. This also fixed my issue by contacting the OpenShift git repo.

+2
Jul 18 '13 at 3:18
source share

Worked for me in Windows 8: The GIT_SSH variable pointed to plink.exe, changed it in the system settings to point to the ssh binary, and this fixed the problem. To find out the full path to ssh, run:

 where ssh 
+2
Oct 14 '16 at 2:18
source share

The same error, here is a different solution - The problem of connecting to GitHub on Windows, even through PuTTY

+1
Feb 17 '11 at 19:07
source share

I ran into the same problem, however the GIT_SSH solution appeared to me once. After rebooting the computer, I realized that this was something else, since I was able to clone my personal repositories without problems without using Git Bash or the command line, but not in Sublime Text 3 with the SublimeGit plugin. My solution was simple and was actually mentioned by @BlueRaja - Danny Pflughoeft , but I thought he could use some direction;)

Basically, you just need to edit ~/.ssh/config and make sure the username is git . You can also tell him that you are using a special SSH key for the Github file - My ~/.ssh/config looks like this:

 Host gh Hostname github.com User git IdentityFile ~/.ssh/github_rsa.pub 

I have a specific key for Github due to the number of other things that I do throughout my day, but if you only have one, then usually there will be ~/.ssh/id_rsa.pub as explained here on Github .

I know that everyone has a different solution, but I will leave it here for everyone who may come across this article without a correction. Good luck

+1
Oct. 15 '14 at 1:01
source share

I got this error when using TortoiseGit to clone a repository from GitHub. Fixed by clicking "Load Putty Key" and selecting a key file (* .pkk) in the Git dialog box.

+1
Jul 14 '15 at 12:09
source share

You can get a link and contest: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

These are PuTTY tools.

0
Aug 18 '10 at 3:24
source share

I had this problem (direct ssh worked, but git pull failed) due to my remote git being not what I was thinking.

Yes, yes, I know this is a stupid mistake, but it happens and it is worth checking.

Use git remote -v

0
Feb 27 '17 at 22:35
source share



All Articles