如何禁用 opensshd 的 diffie-hellman-group14-sha1

如何禁用 opensshd 的 diffie-hellman-group14-sha1

这听起来应该是一个简单的过程,特别是对于那些如何禁用 SSH 2 的 diffie-hellman-group1-sha1,但不知何故却并非如此。

从我的/etc/ssh/sshd_config档案中,我有:

KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256

ssh -T | grep kex表明正在生效:

gssapikexalgorithms gss-gex-sha1-,gss-group14-sha1-
kexalgorithms [email protected],diffie-hellman-group-exchange-sha256

然而,ssh -v显示它仍然提供diffie-hellman-group14-sha1我没有要求的其他功能(请注意,如果我没有 kex 行,这个列表仍然比较小):

debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1

我可以将它添加为第三个选项,但是我无法-在此模式下添加一个来删除它(正如 anx 指出的那样,现在允许以这种方式混合,但它确实显示我确实重新启动了):

Unsupported KEX algorithm "-diffie-hellman-group14-sha1"
/etc/ssh/sshd_config line 133: Bad SSH2 KexAlgorithms '[email protected],diffie-hellman-group-exchange-sha256,-diffie-hellman-group14-sha1'.

你必须做什么才能使我列​​出的算法成为实际提供的唯一算法,特别是禁用 diffie-hellman-group14-sha1

OpenSSH_7.9p1,OpenSSL 1.1.1b FIPS 2019 年 2 月 26 日

相关内容