首页/系统/信创系统运维速查/禁用 SSH 弱加密算法
安全加固65 条

禁用 SSH 弱加密算法

按安全基线收窄 SSH 算法集:KexAlgorithms、Ciphers、MACs 只保留现代算法,兼容老客户端的场景单独评估例外。

信创系统运维速查系统更新于 2026-10-12

配置与验证

配置与验证
# /etc/ssh/sshd_config
KexAlgorithms curve25519-sha256,ecdh-sha2-nistp256
Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-gcm@openssh.com
MACs hmac-sha2-512,hmac-sha2-256
sshd -T | grep -E 'kexalgorithms|ciphers|macs'
sshd -t && systemctl reload sshd
老客户端(旧版终端工具、巡检软件)可能不支持新算法:先看 sshd -T 现状,灰度切换并保留回退配置。

易错点

  • 算法列表拼写错误会导致 sshd 启动失败,reload 前必须 sshd -t
  • 只改服务端不看客户端能力容易改完连不上:测试环境用目标客户端先验证

数据来源与参考

  • man 5 sshd_config(KexAlgorithms/Ciphers/MACs)
  • OpenSSH 官方发行说明
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌