问题原文
原帖链接 · Nicola Mori · CC BY-SA 4.0
I need to disable the following MACs on my OpenSSH server:
[email omitted], [email omitted], hmac-sha2-256, hmac-sha2-512, hmac-sha1
I confgured /etc/ssh/sshd_config with:
Ciphers aes128-ctr,[email omitted],aes192-ctr,aes256-ctr,[email omitted],[email omitted]
KexAlgorithms curve25519-sha256,[email omitted],diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512
MACs [email omitted],[email omitted],[email omitted]
and restarted sshd, but the MACs to be disabled are still enabled:
$ sudo /usr/sbin/sshd -T | grep macs
macs [email omitted],[email omitted],[email omitted],[email omitted],[email omitted],hmac-sha2-256,hmac-sha2-512,hmac-sha1
According to the documentation I found on the web, specifying the MACs parameter in the configuration file should enable only the specified MACs, so I don't understand why also the unspecified ones are still active.
Version info: OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1w
已采纳解答
原帖链接 · larsks · CC BY-SA 4.0
Order matters in your sshd configuration, and the first obtained value wins. Are there any Include directives prior to your attempt to change the crypto settings?
On my Fedora system, /etc/ssh/sshd_config starts with Include /etc/ssh/sshd_config.d/*.conf, and that ultimately includes /etc/crypto-policies/back-ends/opensshserver.config which sets accepted ciphers, macs, etc. Anything I put in sshd_config itself would be ignored if it came after that Include line.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
