github:没有支持的认证方法可用 [英] github: No supported authentication methods available

查看:890
本文介绍了github:没有支持的认证方法可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用github,并且在我的笔记本电脑上成功添加并同步了文件。



截至最近,我开始在运行后收到 PuTTY致命错误:断开连接:没有支持的身份验证方法可用



git pull原点高手(或推送)

然而

gsh git @ github.com返回正确的回应:
错误:您好用户名!您已经成功通过身份验证,但GitHub不提供shell访问
连接到github.com关闭。



在github上发现后,我发现这个morcel:

没有支持的身份验证方法可用
您应该了解环境变量GIT_SSH,git使用它来查找您的ssh-说客户端,如果ssh不适合你。 git安装可能使用plink.exe(通过GIT_SSH)来执行身份验证。如果是这样,请确保您有pageant.exe正在运行,并且您为github创建的密钥加载到该密钥中。这提供了plink.exe的关键;没有它,上面的错误会发生。

不知道什么plink.exe或peagant.exe是..以及ssh git@github.com似乎认证的事实正确地让我想知道这里最好的解决方案是什么..我当然不想过分复杂我的设置,如果没有必要。

解决方案

您可以在主目录中创建一个名为.profile的文件,对我来说就是C:\ Users \



在该文件中,放置以下代码行:

  GIT_SSH =/ usr / bin / ssh.exe

这会设置GIT_SSH环境变量来使用包含在git中的ssh客户端。



当您启动Git Bash命令行时,.profile脚本会被执行。



编辑:
这是我的.profile。它会在您第一次启动git命令提示符时询问您的密码,然后将记住它,直到您重新启动计算机。非常方便,所以你不必每次都想继续输入密码。

  SSH_ENV =$ HOME /.ssh/environment
GIT_SSH =/ usr / bin / ssh.exe

函数start_agent {
echo正在初始化新的SSH代理...
/ usr / bin / ssh-agent | sed's / ^ echo /#echo /'> $ {SSH_ENV}
echo成功
chmod 600$ {SSH_ENV}
。 $ {SSH_ENV}> / dev / null
/ usr / bin / ssh-add;
}

#源SSH设置(如果适用)
if [-f$ {SSH_ENV}];然后
。 $ {SSH_ENV}> / dev / null
#ps $ {SSH_AGENT_PID}在cygwin
下无效ps -ef | grep $ {SSH_AGENT_PID} | grep ssh-agent $> / dev / null || {
start_agent;
}
else
start_agent;
fi


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.

解决方案

You can create a file named ".profile" in your home directory, for me that's C:\Users\[user]

Inside that file, put 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 with git.

The .profile script gets executed when you start your Git Bash command line.

Edit: This is my .profile. It will ask you for your password the first time you start the git command prompt, then will remember it from then on, until you reboot your computer. Very handy so you don't have to keep entering your password each 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

这篇关于github:没有支持的认证方法可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆