首页/安全/应急响应速查/sshd_config 后门与降险配置检查

sshd_config 后门与降险配置检查

sshd 配置被改动即可开长期后门:AuthorizedKeysFile 指向诡异路径、PermitRootLogin yes、放行转发都可能被滥用。

应急响应速查安全更新于 2026-10-12
检查方式sshd -T 输出最终生效配置
高危项AuthorizedKeysFile 异常、PermitEmptyPasswords yes
可疑项PermitRootLogin yes、AllowTcpForwarding yes
记录与基线 diff 加文件时间

导出并筛查生效配置

导出并筛查生效配置
sshd -T | grep -iE 'permitrootlogin|passwordauthentication|permitemptypasswords|authorizedkeysfile|allowtcpforwarding'
ls -l /etc/ssh/sshd_config
sshd -T 展示的是包含 Include 之后的最终值,比直接读主配置更可靠。

易错点

  • 只读主文件不看 Include 与 .d 目录:真实生效值可能在别处
  • 查完不对比基线:分不清哪一行是入侵后加的

数据来源与参考

  • OpenSSH sshd_config(5) 手册

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌