在 centOS/RHEL 7 服务器中尝试通过 TMA 脉冲安全工具访问服务器并在 /var/log/secure 上出现以下错误
[root@rhellinuxserver ~]# cat /var/log/secure| grep -iE "没有匹配"
8 月 24 日 07:02:07 rhellinuxserver sshd[29958]:无法与 172.21.112.111 端口 16899 协商:找不到匹配的 MAC。他们的报价:hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160@openssh.com [preauth]
8 月 24 日 07:15:24 rhellinuxserver sshd[30702]:无法与 172.21.112.111 端口 33541 协商:找不到匹配的 MAC。他们的报价:hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160@openssh.com [preauth]
要解决此问题,请编辑 sshd_config 文件,如下所述
# cat -n /etc/ssh/sshd_config | grep -i MACs
找线
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256, umac-128@openssh.com
替换为
MACs hmac-sha1,hmac-sha1-96,hmac-md5,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac -sha2-512,hmac-sha2-256,hmac-ripemd160
这将添加以下额外的 MACs 算法。
hmac-sha1,hmac-sha1-96,hmac-md5,hmac-ripemd160
立即重启 SSHD 服务
systemctl restart sshd
现在可以访问服务器,在 /var/log/secure 日志文件中找到成功结果。
猫 /var/log/secure| grep -i 接受
8 月 24 日 07:18:24 rhellinuxserver sshd[548]:接受来自 172.21.112.111 端口 53776 ssh2 的用户名密码