简体   繁体   English

Git:权限被拒绝(公钥)。 致命:无法从远程存储库读取

[英]Git: Permission denied (publickey). fatal: Could not read from remote repository

I've never cloned a private GitHub repository.我从未克隆过私有 GitHub 存储库。 So I followed GitHub's guide but it's still rejecting me.所以我遵循了 GitHub 的指南,但它仍然拒绝我。 I have a Red Hat linux server on AWS.我在 AWS 上有一个 Red Hat linux 服务器。 I did the following:我做了以下事情:

  1. Ran ssh-keygen -t rsa -b 4096 -C "< my github email address >" . Ran ssh-keygen -t rsa -b 4096 -C "< my github email address >"
  2. Ran eval "$(ssh-agent -s)" .运行eval "$(ssh-agent -s)"
  3. Ran ssh-add ~/.ssh/id_rsa .ssh-add ~/.ssh/id_rsa
  4. Ran cat ~/.ssh/id_rsa.pub (to get the value of the key). Ran cat ~/.ssh/id_rsa.pub (获取密钥的值)。
  5. Added output of step 4 into here: https://github.com/settings/keys .将第 4 步的输出添加到此处: https : //github.com/settings/keys
  6. Ran ssh -T git@github.com and it outputted this: Ran ssh -T git@github.com它输出了这个:

    Hi AskYous!问好! You've successfully authenticated, but GitHub does not provide shell access.您已成功通过身份验证,但 GitHub 不提供 shell 访问。

  7. Ran sudo git clone git@github.com:AskYous/google-code-challange.git (a private repository I own). Ran sudo git clone git@github.com:AskYous/google-code-challange.git (我拥有的私人存储库)。 This is when I got the following error:这是我收到以下错误时:

    Cloning into 'google-code-challange'... Permission denied (publickey).克隆到 'google-code-challange'... 权限被拒绝(公钥)。 fatal: Could not read from remote repository.致命:无法从远程存储库读取。

    Please make sure you have the correct access rights and the repository exists.请确保您拥有正确的访问权限并且存储库存在。

  8. I checked GitHub and it acknowledges that the key has been used:我检查了 GitHub,它承认密钥已被使用: 在此处输入图片说明

The problem was, and I don't know how this happened, is that the private key changed so this new key was not stored on GitHub.问题是,我不知道这是怎么发生的,是私钥发生了变化,所以这个新密钥没有存储在 GitHub 上。 It changed somehow.它以某种方式改变了。 Perhaps I ran the generation process twice.也许我运行了两次生成过程。

Just want to help anyone who's experiencing this issue as I spent a while trying to resolve.只是想帮助遇到此问题的任何人,因为我花了一段时间试图解决。 Make sure the key pairs ownership owned by buildkite-agent确保 buildkite-agent 拥有的密钥对所有权

-rw-r--r--. -rw-r--r--。 1 buildkite-agent buildkite-agent 749 Jul 27 13:34 id_rsa.pub -rw-------. 1 buildkite-agent buildkite-agent 749 Jul 27 13:34 id_rsa.pub -rw-------。 1 buildkite-agent buildkite-agent 3243 Jul 27 13:34 id_rsa 1 buildkite-agent buildkite-agent 3243 Jul 27 13:34 id_rsa

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GIT 权限被拒绝(公钥) - 致命无法从远程存储库读取 - GIT permission denied (publickey) - Fatal could not read from remote repository Git:权限被拒绝(公钥)致命 - 无法从远程存储库读取。 克隆 Git 存储库时 - Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository GitHub:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - GitHub: Permission denied (publickey). fatal: Could not read from remote repository Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository git@gitlab.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository 使用ssh访问bitbucket的Jenkins git插件:权限被拒绝(publickey)。 致命:无法从远程存储库读取 - Jenkins git plugin with ssh access to bitbucket: Permission denied (publickey). fatal: Could not read from remote repository Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push 错误$ git pull --rebase权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Error $ git pull --rebase Permission denied (publickey). fatal: Could not read from remote repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM