git 推送到github时突然出现“没有支持的身份验证方法可用”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2657786/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 08:15:12  来源:igfitidea点击:

Suddenly getting "No supported authentication methods available" when pushing to github

gitgithubtortoisegit

提问by ripper234

I started a github project a few weeks ago. I was able to push changes without any problems (I'm using TortoiseGIT).

几周前我开始了一个 github 项目。我能够毫无问题地推送更改(我使用的是 TortoiseGIT)。

Suddenly today when I tried to push my changes, I got "PuTTY Fatal Error" "Disconnected: No supported authentication methods availble" error window.

今天突然当我尝试推送我的更改时,我收到了“PuTTY 致命错误”“断开连接:没有可用的支持的身份验证方法”错误窗口。

Anything you can recommend to remedy the problem?

你有什么可以推荐的来解决这个问题吗?

采纳答案by ripper234

I figured it out - it happened because I reinstalled TortoiseGIT since starting to work on the project. Pulls went smoothly, but as soon as I tried to push back my changes TortoiseGIT needed my authentication key, which was not configured.

我想通了——这是因为我从开始从事该项目后重新安装了 TortoiseGIT。拉动进行得很顺利,但是一旦我试图推回我的更改 TortoiseGIT 需要我的身份验证密钥,该密钥未配置。

Edit

编辑

To resolve, I simply cleared all authentication data from my TortoiseGit, under: Context menu "Tortoise Git" -> Settings -> Saved Data -> Authentication data [Clear]

为了解决这个问题,我简单地从我的 TortoiseGit 中清除了所有身份验证数据,在:上下文菜单“Tortoise Git” -> 设置 -> 保存的数据 -> 身份验证数据 [清除]

回答by Shachar Hamuzim Rajuan

For me there was a problem to perform actions against the remote repository only when using TortoiseGit, through CMD / GitBashthere have been no issue at all.

对我来说,只有在使用 TortoiseGit 时才对远程存储库执行操作存在问题,通过CMD/GitBash根本没有问题。

So what I did was Very simple:I opened TortoiseGit-->Settings--> Networkand in SSH Client I changed to "C:\Program Files\Git\usr\bin\ssh.exe" instead of "TortoiseGitPlink.exe".

所以我所做的很简单:我打开TortoiseGit-->设置-->网络,然后在 SSH 客户端中更改为“C:\Program Files\Git\usr\bin\ssh.exe”而不是“TortoiseGitPlink.exe” .

回答by Gerold Meisinger

Make sure you installed TortoiseGit with OpenSSHand that you use the SSH authentication method. If you installed with Putty, there may be a "computer symbol" in the systray called "Putty Pageant".

确保使用 OpenSSH安装TortoiseGit并使用SSH 身份验证方法。如果您安装了 Putty,系统托盘中可能会有一个名为“Putty Pageant”的“计算机符号”。

回答by QAZZY

I was able to fix this error by adding the private key into Pageant. I forgot to do this during the key creation, and once I added it I no longer received the error.

我能够通过将私钥添加到 Pageant 来修复此错误。我在创建密钥的过程中忘记这样做了,一旦我添加了它,我就不再收到错误消息。

回答by Simon East

For TortoiseGit Users on Windows
(as I originally posted in this question)

对于 Windows 上的 TortoiseGit 用户
(正如我最初在此问题中发布的那样)

I used to setup most of my Github/Bitbucket repositories using the SSH repository URLsas (originally) it used to be the only convenient way to prevent TortoiseGit from prompting for your password on every single action.

我曾经使用SSH 存储库 URL设置我的大部分 Github/Bitbucket 存储库,因为(最初)它曾经是防止 TortoiseGit 在每个操作中提示输入密码的唯一便捷方法。

But setting TortoiseGit up this way was always hair-pullingly painful. Every time it took me hoursto set up correctly, as the default installation options never seemed to work (even as of 2016, sheesh!).

但是以这种方式设置 TortoiseGit 总是令人毛骨悚然。每次我都需要花费数小时才能正确设置,因为默认安装选项似乎从未奏效(即使在 2016 年,天哪!)。

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

但是 TortoiseGit 现在对 HTTPS 有更好的密码管理,而且Github 实际上建议尽可能使用 HTTPS URL

SSH URL: [email protected]:User/repo-name.git

HTTPS URL: https://github.com/User/repo-name.git

SSH 网址: [email protected]:User/repo-name.git

HTTPS 网址: https://github.com/User/repo-name.git

The benefits of HTTPS are:

HTTPS 的好处是:

  • No managing or generating of SSH keys
  • No need to have pageant.execonstantly running (which requests your password on each launch)
  • Using TortoiseGit from Australia, I find that clones over HTTPS are 5-10x faster than SSH
  • 无需管理或生成 SSH 密钥
  • 无需pageant.exe不断运行(每次启动时都会要求输入密码)
  • 使用来自澳大利亚的 TortoiseGit,我发现通过 HTTPS 的克隆比 SSH 快 5-10 倍

回答by Prusdrum

In my case, Tortoise Git lost PuttyKey. So I had to go to TortoiseGit settings > Git > Remoteand in this section I clicked on Remoteframe my originand PuttyK Key was not set (It was before). I had to set it up again.

就我而言,Tortoise Git 丢失了 PuttyKey。因此,我必须转到 TortoiseGit设置 > Git > 远程,在本节中,我单击了远程框架,我的原点和 PuttyK 密钥未设置(之前是)。我不得不重新设置它。

回答by Tomá? Zato - Reinstate Monica

To fix this, I had to manually run Pageant from the start menu:

为了解决这个问题,我必须从开始菜单手动运行 Pageant:

image description

图片说明

Afterwards, I saw pageant in the system tray:

之后,我在系统托盘中看到了选美:

image description

图片说明

I could add my key. Normally, keys are in %userprofile%\.ssh.

我可以添加我的密钥。通常,密钥在%userprofile%\.ssh.

回答by ianbeks

For me I was getting this error after upgrading GIT to 2.8.0. The issue was due to the $HOME directory being incorrectly read by bash and defaulting to some system location under the windows installation folder: /c/Windows/system32/config/systemprofile.

对我来说,我在将 GIT 升级到 2.8.0 后收到此错误。该问题是由于 $HOME 目录被 bash 错误读取并默认为 Windows 安装文件夹下的某个系统位置:/c/Windows/system32/config/systemprofile.

Turns out that a little environment variable cleanup was required. A long while ago I had installed a version of GIT (about 1.7.x) which had created a HOME variable in the system environment variables. This needed to be removed after upgrading to 2.8.0 due to some change in behaviour, rather than adding a further HOME user environment variable.

事实证明,需要进行一些环境变量清理。很久以前,我安装了一个 GIT 版本(大约 1.7.x),它在系统环境变量中创建了一个 HOME 变量。由于行为发生了一些变化,因此需要在升级到 2.8.0 后将其删除,而不是添加进一步的 HOME 用户环境变量。

回答by pacomix

See my post here. I had this problem just now and tried everything posted here but I couldn't solve it. At the end was this exact same problem related to an existing PuTTy configuration => [TortoiseSVN keeps on asking me for my password

在这里看到我的帖子。我刚刚遇到了这个问题并尝试了这里发布的所有内容,但我无法解决它。最后是与现有 PuTTy 配置相关的完全相同的问题 => [ TortoiseSVN 不断询问我的密码

回答by Dan

I had this same error, which randomly occurred out of the blue after having successfully pushed to my repository over many months. In my case, in Tortoisegit->Settings->Git->Remote, the Push URLfield was somehow empty.

我遇到了同样的错误,这是在成功推送到我的存储库几个月后突然发生的。就我而言,在Tortoisegit->Settings->Git->Remote 中推送 URL字段不知何故为空。