首页/系统/信创系统运维速查/认证次数超限(Too many authentication failures)
常见问题65 条

认证次数超限(Too many authentication failures)

报 Too many authentication failures 是 agent 密钥过多逐个尝试所致:客户端精确指定密钥,服务端按需调整尝试上限。

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

客户端处理

客户端处理
ssh-add -l                                   # agent 已加载密钥
ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 user@host
ssh -o PreferredAuthentications=publickey -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 user@host

服务端参数

服务端参数
# /etc/ssh/sshd_config
# MaxAuthTries 6          # 调大放宽需评估安全影响
sshd -t && systemctl reload sshd
图形环境密钥环会预加载大量密钥:可临时 ssh-add -D 清空,或按主机在 ~/.ssh/config 中固定 IdentityFile。

易错点

  • 调大 MaxAuthTries 有安全取舍:优完精确指定使用哪个密钥
  • ~/.ssh/config 内 Host 分组配置 IdentityFile 可长期规避

数据来源与参考

  • man 5 ssh_config
  • man 5 sshd_config
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌