为何Git克隆Apache OFBiz框架时出现消息验证码错误?
无法克隆Apache OFBiz框架仓库的问题分析
执行的命令及错误输出
$ git clone --recurse-submodules git@github.com:apache/ofbiz-framework.git && \ git submodule update --remote && \ git add . && \ git commit -m "Updated the submodules" && \ git push Cloning into 'ofbiz-framework'... remote: Enumerating objects: 458146, done. remote: Counting objects: 100% (1320/1320), done. remote: Compressing objects: 100% (595/595), done. ssh_dispatch_run_fatal: Connection to 140.82.112.4 port 22: message authentication code incorrect fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output
用户问题
能克隆自己GitHub仓库的项目,但无法拉取Apache的OFBiz框架,请问错误原因是什么?
系统及Git版本信息
系统版本
lsb_release -a No LSB modules are available. Distributor ID: Kali Description: Kali GNU/Linux Rolling Release: 2022.4 Codename: kali-rolling
Git版本
git version 2.35.1
错误原因及解决办法
核心原因
错误提示中的ssh_dispatch_run_fatal: Connection to 140.82.112.4 port 22: message authentication code incorrect是关键,说明SSH连接的消息验证码校验失败,常见原因包括:
- SSH客户端与GitHub服务器的MAC(消息认证码)算法不兼容
- 网络环境(防火墙、代理、网关)篡改了SSH数据包
- 本地SSH客户端存在版本兼容性问题
解决办法
修改SSH配置,指定兼容的MAC算法
编辑~/.ssh/config文件(不存在则新建),添加以下内容:Host github.com MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256保存后重新执行克隆命令。
改用HTTPS协议克隆
替换SSH地址为HTTPS地址,绕过SSH验证环节:git clone --recurse-submodules https://github.com/apache/ofbiz-framework.git排查网络环境
关闭本地防火墙、代理,或者切换到其他网络环境(如移动热点)后重试,排除网络设备干扰的可能。
内容的提问来源于stack exchange,提问作者jnbdz
相关产品推荐
相关产品推荐

