大网数据广告活动
服务器运维问答

Disable insecure MACs for sshd

· 52CE 我爱测

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,…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2024-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。