本地计算机有一个使用 SSH 克隆的 bitbucket 存储库。Windows 11 更新后,git push/pull 等导致错误“kex 协议错误:类型 30 序列 1“。经过几个小时的调试,我还是找不到可行的解决方案。
我做了什么
- 更新了 git scm
- 更新了 putty
- 将 Git bash ssh 客户端更改为 putty
- 改变了 putty 中 diffie-hellman 密钥交换优先级的顺序
- 将 diffie-hellman-group14-sha1 添加到 sshd_config 文件/添加了
- 尝试过 putty、powershell、visual studio code 等
- 生成新的 ssh 密钥并将其添加到 ssh 代理
似乎什么都没起作用。我遗漏了什么吗?或者有什么可以做的吗?请帮忙
更新-我的 sshd_config 文件的内容
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
调试日志
OpenSSH_8.5p1, OpenSSL 1.1.1k 25 Mar 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.org [2406:da00:ff00::3403:4be7] port 22.
debug1: Connection established.
debug1: identity file /c/Users/me/.ssh/id_rsa type 0
debug1: identity file /c/Users/me/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/me/.ssh/id_dsa type -1
debug1: identity file /c/Users/me/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/me/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/me/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/me/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/mev/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/me/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/me/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/me/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/me/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/me/.ssh/id_xmss type -1
debug1: identity file /c/Users/me/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.5
debug1: compat_banner: match: OpenSSH_8.5 pat OpenSSH* compat 0x04000000
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: load_hostkeys: fopen /c/Users/me/.ssh/known_hosts: No such file or directory
debug1: load_hostkeys: fopen /c/Users/me/.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: [email protected]
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
kex protocol error: type 30 seq 1
debug1: Received SSH2_MSG_UNIMPLEMENTED for 1
解决方案
经过这么多事情,操作系统更新和软件更改,该问题与网络的 IP 地址有关。 IPv4 中一切正常。上述错误仅发生在 IPv6 网络上。这可能与 bitbucket 对其 SSH 密钥交换的实现有关。希望这对某些人有帮助