定位阶段
定位阶段
ssh -vvv user@host 2>&1 | grep -E 'Entering|Authenticating|offer' | head -30
# 服务端结合日志看时间点:
journalctl -u sshd --since '10 min ago' | tail -20常见调整
常见调整
# /etc/ssh/sshd_config(按需):
# UseDNS no
# GSSAPIAuthentication no
sshd -t && systemctl reload sshd
# 客户端多密钥尝试:
ssh -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 user@host「能登录但很慢」多与认证前协商有关;「登录后被踢或卡死」则要查会话资源与 PAM。