github ssh 认证失败

2022-09-30 19:28:09 +08:00
 fangwenxue
➜  pyList git:(master) ✗ ssh -T git@github.com -v

OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /Users/caoyufei/.ssh/config
debug1: /Users/caoyufei/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /Users/caoyufei/.ssh/id_rsa type 0
debug1: identity file /Users/caoyufei/.ssh/id_rsa-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_dsa type -1
debug1: identity file /Users/caoyufei/.ssh/id_dsa-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_ecdsa type -1
debug1: identity file /Users/caoyufei/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_ecdsa_sk type -1
debug1: identity file /Users/caoyufei/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_ed25519 type 3
debug1: identity file /Users/caoyufei/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_ed25519_sk type -1
debug1: identity file /Users/caoyufei/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /Users/caoyufei/.ssh/id_xmss type -1
debug1: identity file /Users/caoyufei/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6
debug1: compat_banner: match: OpenSSH_7.6 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to github.com:22 as 'git'
debug1: load_hostkeys: fopen /Users/caoyufei/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
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: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-rsa SHA256:rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0
debug1: load_hostkeys: fopen /Users/caoyufei/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/caoyufei/.ssh/known_hosts:2
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE
debug1: Will attempt key: /Users/caoyufei/.ssh/id_dsa
debug1: Will attempt key: /Users/caoyufei/.ssh/id_ecdsa
debug1: Will attempt key: /Users/caoyufei/.ssh/id_ecdsa_sk
debug1: Will attempt key: /Users/caoyufei/.ssh/id_ed25519 ED25519 SHA256:TKYtFMT/9O9RJ0IR1TvhrGE8KVYlOhNeQC2haFGT8Hs
debug1: Will attempt key: /Users/caoyufei/.ssh/id_ed25519_sk
debug1: Will attempt key: /Users/caoyufei/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /Users/caoyufei/.ssh/id_dsa
debug1: Trying private key: /Users/caoyufei/.ssh/id_ecdsa
debug1: Trying private key: /Users/caoyufei/.ssh/id_ecdsa_sk
debug1: Offering public key: /Users/caoyufei/.ssh/id_ed25519 ED25519 SHA256:TKYtFMT/9O9RJ0IR1TvhrGE8KVYlOhNeQC2haFGT8Hs
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /Users/caoyufei/.ssh/id_ed25519_sk
debug1: Trying private key: /Users/caoyufei/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
git@github.com's password:
1687 次点击
所在节点    问与答
14 条回复
ob
2022-09-30 19:50:14 +08:00
config 文件有配置啥吗?
fangwenxue
2022-09-30 20:07:56 +08:00
@ob
Host *
ServerAliveInterval 60
skybig
2022-09-30 21:37:42 +08:00
config 里指定下 IdentityFile 用哪个密钥
fangwenxue
2022-09-30 21:42:39 +08:00
@skybig 指定了一样
```
debug1: Will attempt key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE explicit agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
git@github.com's password:
```
skybig
2022-09-30 22:21:29 +08:00
@fangwenxue 那不知道了。要不你看看更新公告,是不是需要修改认证方式之类的。
zk8802
2022-09-30 23:23:32 +08:00
github.com 的 IP 对吗?
november
2022-10-01 00:25:01 +08:00
ping 下 github ,大概率是运营商搞 dns 污染。
ob
2022-10-01 00:34:12 +08:00
ssh-add -k /Users/caoyufei/.ssh/id_rsa
试下有没有用
FanyFull
2022-10-01 00:40:18 +08:00
最近遇到了类似的问题,给 ssh 设置了代理之后解决了。
fangwenxue
2022-10-01 09:58:45 +08:00
@ob 也不行
liuidetmks
2022-10-01 10:02:24 +08:00
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints


我也遇到了你一样的问题 win10 ,也是这个公钥 rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0

但是上面文档里面好像说官方只有 3 个公钥,不包含这个,不知道是不是文档没更新的原因
fangwenxue
2022-10-01 10:02:31 +08:00
@november 还真的是,换了 dns 就可以了
ob
2022-10-01 10:02:50 +08:00
@fangwenxue 如果你只有一个账号,直接把 config 移除,放到别的目录,试下默认的。
fangwenxue
2022-10-01 10:02:55 +08:00
@liuidetmks 解决了,dns 问题

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/884092

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX