SecureCRT 连接 Debian 常见报错原因和对应解决办法如下,你可以按报错现象对号入座:
现象:连不上,提示 Connection refused
可能原因 & 解决:
systemctl status ssh
若没运行:
sudo apt update
sudo apt install openssh-server
sudo systemctl enable --now ssh
sudo ufw status
若开启,允许 SSH:
sudo ufw allow ssh
sudo nano /etc/ssh/sshd_config
确认:
PermitRootLogin prohibit-password
# 或
PermitRootLogin yes
改完:
sudo systemctl restart ssh
现象:
No compatible key exchange methodAlgorithm negotiation failed原因:Debian 新版本 SSH 太新,SecureCRT 太老
解决(二选一):
✅ 推荐:升级 SecureCRT(8.x 以上)
✅ 或临时在 Debian 放宽算法:
sudo nano /etc/ssh/sshd_config
添加:
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc,3des-cbc
重启:
sudo systemctl restart ssh
现象:
host key type ssh-rsa not accepted
Debian 12+ 默认禁用 ssh-rsa
解决:
sudo nano /etc/ssh/sshd_config
加:
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
重启 SSH。
检查:
passwd -S 用户名
grep PasswordAuthentication /etc/ssh/sshd_config
应为:
PasswordAuthentication yes
如果你能把 具体报错截图或文字 发出来,我可以直接告诉你哪一步错了。