git - 为什么我不能再运行 git 命令(错误 : no matching mac found: client hmac-md5. ..)

标签 git macos

我没有在我的机器上改变任何东西。每次更改我的代码时,我都会运行此命令。

git push thing-staging beta-staging:master

我得到的响应是:

找不到匹配的 mac:客户端 hmac-md5....致命:远程端意外挂断

有人对为什么这不再有效或如何找出到底发生了什么有任何建议吗?

最佳答案

您的本地 ssh 似乎与您要推送到的 git 存储库上使用的 ssh 服务器不兼容。听起来服务器正在运行旧版本的 ssh 服务器,而您的新客户端已放弃对 hmac-md5 算法的默认支持(因为该算法现在被认为是不安全的)。

您可以使用 ~/.ssh/config 文件中的 MACs 配置选项修改 ssh 使用的 MAC 算法。根据ssh_config man page ,启用的 MAC 的默认列表是:

umac-64-etm@openssh.com,umac-128-etm@openssh.com, 
hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 
hmac-sha1-etm@openssh.com, 
umac-64@openssh.com,umac-128@openssh.com, 
hmac-sha2-256,hmac-sha2-512,hmac-sha1

以上内容可能与版本有关。您需要将 hmac-md5 添加到此列表中,因此您将添加到您的 ~/.ssh/config 中,例如:

MACs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5

这会将配置应用于所有您的 ssh 连接;您还可以使用 Match 指令将其仅应用于托管远程 git 存储库的服务器。有关详细信息,请参阅 ssh_config 手册页。

关于git - 为什么我不能再运行 git 命令(错误 : no matching mac found: client hmac-md5. ..),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46938362/

相关文章:

git - 是否有一个 git log 参数来过滤只有大变化的文件?

gitignore 不会忽略文件

macos - 使用 JavaScriptCore 更改 JSContext 传递的 Swift 对象

python - 在 Mac OSX 上从 Python 3.6 运行 wine 命令

python - 在 OS X 上编写一个全屏不可关闭的窗口

git-instaweb 和 git-clone

Git别名附加参数结束

jquery - 从 github 文件加载 json

java - Swing 中的统一工具栏无法正常工作

python - 如何避免使用 Python 2.7 在 OS X 10.8 上创建 .pyc 文件?