【问题标题】:Git Hub remote: Password authentication is not available for Git operationsGit Hub 远程:密码验证不适用于 Git 操作
【发布时间】:2019-02-19 10:35:25
【问题描述】:

我是新来的乌龟 git 并用于我的 Github 企业。当我尝试从 Tortoise git 提交我的文件时,它可以工作,但是当我尝试推送它时会抛出以下错误

remote:密码验证不适用于 Git 操作。

远程:您必须使用个人访问令牌或 SSH 密钥。

远程:见https://github.********.com/settings/tokens 或https://github.******.com/settings/ssh 致命:无法访问'https://github.ford.com/****/****.git/':

请求的 URL 返回错误:403

我在尝试克隆时遇到同样的错误。我只能提交文件。

但是当我尝试使用示例 github.com 而不是企业时,一切正常。 请在这方面给我建议。

如果我需要为身份验证设置任何内容,请指导我

【问题讨论】:

标签: github git-push tortoisegit git-clone


【解决方案1】:

有两种认证方式:

  1. 在每次 git push/pull/clone 时使用用户名/密码提示
  2. 设置 SSH 密钥并让您的 rsa 密钥对您进行身份验证(这是广泛的首选)。

我认为福特选择了方法 2。

下面来自 Github 的文章应该可以帮到你。

https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

按照它并确保你添加了你想要访问 repo 的所有机器的 SSH 密钥。

【讨论】:

  • 我也做了同样的事情,并将 SSH 密钥添加到我的 github,但没有成功。仍然给我同样的错误。克隆到 'C:\Users\Shankaran\Documents\Github test\aem-spl'... 远程:密码验证不适用于 Git 操作。远程:您必须使用个人访问令牌或 SSH 密钥。远程:见github.ford.com/settings/tokensgithub.ford.com/settings/ssh致命:无法访问'github.ford.com****/***.git/':请求的URL返回错误:403
  • 确保您使用的克隆 url 以 git@github.com:* 开头,如果使用 ssh auth,则必须使用它。如果您使用以 http 开头的克隆网址,它将采用答案中提到的第一种方法
【解决方案2】:

您可以创建访问令牌并将其存储在 Windows 凭据管理器中。

  • 按照this link 中的步骤创建访问令牌。
  • 转到“Windows Credential Manager”并查找您的 Github Enterprise 帐户。
  • 点击修改,将密码替换为您生成的令牌。

【讨论】:

    【解决方案3】:

    生成您的 SSH 公钥并将其替换为 GitHub 密码应该会有所帮助。

    第 1 步:转到您的 IDE>>终端 - 在 cmd 下运行并按照后续步骤填充

     $ ssh-keygen -o
    

    第二步:等待一段时间,验证<given path>中是否生成了给定的<filename.pub>

    第 3 步:将生成的 .pub 密钥替换为 GitHub 帐户的密码。

    Windows 用户转到Control Panel\All Control Panel Items\Credential Manager。点击Windows Credentials,寻找GitHub账号,选择并编辑.pub key的密码

    参考Generating Your SSH Public Key

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-11
      • 1970-01-01
      • 2017-08-23
      • 2022-07-20
      • 2017-02-11
      • 1970-01-01
      • 2018-08-06
      相关资源
      最近更新 更多