首页 > 解决方案 > 由于身份被拒绝,我无法克隆 Github Repo

问题描述

我很抱歉我已经做了好几天了。我正在尝试为我正在做的项目克隆一个 github 存储库。当我试图克隆它时,它又回来了

Cloning into 'send-email-lambda'...
no such identity: /custom/dir/custom-key: No such file or directory
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

我发现我的 github 中没有注册 ssh 密钥,我经历了这个过程。这是一种痛苦。我生成了一个新的 ssh 密钥并将其添加到我的 github。我遵循了 github 文档,但它仍然无法正常工作。我试图检查日志,但我不知道我在寻找什么。

Please make sure you have the correct access rights
and the repository exists.
Brian'sMac:code briansantos$ ssh -vT git@github.com
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/briansantos/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /custom/dir/custom-key type -1
debug1: identity file /custom/dir/custom-key-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version babeld-8112423e
debug1: no match: babeld-8112423e
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/briansantos/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /custom/dir/custom-key  explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /custom/dir/custom-key
no such identity: /custom/dir/custom-key: No such file or directory
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
Brian'sMac:code briansantos$ 

有人可以给我一些见解吗?

标签: gitgithubssh

解决方案


作为快速修复,我建议您使用 克隆https,这将允许您使用您的github凭据登录。


推荐阅读