git@github.com:权限被拒绝(公钥),而公钥已添加到github

时间:2020-05-31 12:36:26

标签: git github

我已将公共密钥作为ssh-keygen生成的testkey.pub的内容添加到我的Github中,而相应的测试密钥已经在我的本地计算机中。当我在提交后尝试推送时,它给了我下面的错误。

 C:\CRMNext\Git\speech_to_text_auto_2>dir testkey.pub
 Volume in drive C is OS
 Volume Serial Number is 8EE7-4A30

 Directory of C:\CRMNext\Git\speech_to_text_auto_2

31-05-2020  17:51               753 testkey.pub
               1 File(s)            753 bytes
               0 Dir(s)  573,783,420,928 bytes free

C:\CRM\Git\speech_to_text_auto_2>git remote -v
origin  git@github.com:Sarrae1406/speech_to_text_auto_2.git (fetch)
origin  git@github.com:Sarrae1406/speech_to_text_auto_2.git (push)

C:\CRM\Git\speech_to_text_auto_2>git push -u origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

无法理解为什么我仍然遇到公钥访问问题。

ssh -Tv git@github.com的输出如下:

C:\CRM\Git\speech_to_text_auto_2>ssh -Tv git@github.com
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Connecting to github.com [13.234.210.38] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\KASTURI/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\KASTURI/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version babeld-f6e22739
debug1: no match: babeld-f6e22739
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 C:\\Users\\KASTURI/.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: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
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: Offering public key: RSA SHA256:oO3mEoN/peXiKM2lmj07Sa6JY+IASJ88bsIM2tgOawA C:\\Users\\KASTURI/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: C:\\Users\\KASTURI/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\KASTURI/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\KASTURI/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\KASTURI/.ssh/id_xmss
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

0 个答案:

没有答案