我需要在 OpenSSH 服务器上禁用以下 MAC:
[email protected], [email protected], hmac-sha2-256, hmac-sha2-512, hmac-sha1
我配置/etc/ssh/sshd_config
了:
Ciphers aes128-ctr,[email protected],aes192-ctr,aes256-ctr,[email protected],[email protected]
KexAlgorithms curve25519-sha256,[email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
MACs [email protected],[email protected],[email protected]
并重新启动 sshd,但要禁用的 MAC 仍然启用:
$ sudo /usr/sbin/sshd -T | grep macs
macs [email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
根据我在网上找到的文档,MACs
在配置文件中指定参数应该仅启用指定的MAC,所以我不明白为什么未指定的MAC仍然处于活动状态。
版本信息:OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1w
顺序在 sshd 配置中很重要,第一个获得的值获胜。在尝试更改加密设置之前是否有任何包含指令?
在我的 Fedora 系统上,
/etc/ssh/sshd_config
以 开头Include /etc/ssh/sshd_config.d/*.conf
,最终包括/etc/crypto-policies/back-ends/opensshserver.config
设置接受的密码、mac 等。sshd_config
如果我在 Include 行之后放入的任何内容都将被忽略。