当前现象
通过 SSH 登录服务器时出现以下提示:
Unable to negotiate with 192.168.1.1 port 22: no matching MAC found. Their offer: hmac-sha1-96,hmac-sha1,hmac-md5
解决方法
方法一:添加参数
在 ssh 命令中添加参数,指定算法,例如:
ssh root@192.168.1.1 -o macs=hmac-sha1,hmac-md5
方法二:修改配置文件
修改 SSH 客户端配置文件 ~/.ssh/config
,添加内容:
# 对全部服务器生效
MACs +hmac-sha1,hmac-md5
# 对指定的服务器生效
Host ExampleServer
HostName 192.168.1.1
Port 22
User root
MACs +hmac-sha1,hmac-md5