在 Linux 下使用 SecureCRT 登录失败,原因很多,可以按下面顺序逐项排查。常见问题和对应解决方法如下:
ping 目标IP
在目标 Linux 服务器上执行:
systemctl status sshd
如果未启动:
systemctl start sshd
systemctl enable sshd
确认端口监听:
ss -lntp | grep ssh
✅ 原因:
✅ 解决:
# 防火墙放行
firewall-cmd --add-service=ssh --permanent
firewall-cmd --reload
或(iptables):
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
✅ 原因:
✅ 解决:
✅ 原因:
✅ 解决:
passwd 用户名
检查:
grep PasswordAuthentication /etc/ssh/sshd_config
应为:
PasswordAuthentication yes
修改后重启 sshd:
systemctl restart sshd
✅ 原因:
~/.ssh/authorized_keys✅ 解决:
服务器检查:
ls -ld ~/.ssh
ls -l ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
✅ 原因:
✅ 解决:
KexAlgorithms curve25519-sha256,diffie-hellman-group14-sha1
passwd -S 用户名
确认:
grep 用户名 /etc/passwd
tail -f /var/log/secure
# 或
journalctl -u sshd -f
登录失败时,日志会直接给出原因。
getenforce
如果是 Enforcing,可临时测试:
setenforce 0
若恢复正常,需调整 Selinux 策略。
如果你愿意,可以把 SecureCRT 的具体报错截图或文字 发出来,我可以直接帮你定位是哪一类问题。