温馨提示×

securecrt连debian出错咋办

小樊
41
2026-09-07 20:03:07
栏目: 智能运维

SecureCRT 连接 Debian 常见报错原因和对应解决办法如下,你可以按报错现象对号入座:


一、连接直接被拒绝(Connection refused)

现象:连不上,提示 Connection refused

可能原因 & 解决:

  1. SSH 服务没开
systemctl status ssh

若没运行:

sudo apt update
sudo apt install openssh-server
sudo systemctl enable --now ssh
  1. 防火墙挡了
sudo ufw status

若开启,允许 SSH:

sudo ufw allow ssh
  1. Debian 默认不允许 root 登录 编辑:
sudo nano /etc/ssh/sshd_config

确认:

PermitRootLogin prohibit-password
# 或
PermitRootLogin yes

改完:

sudo systemctl restart ssh

二、提示“密钥交换失败 / 算法不支持”

现象

  • No compatible key exchange method
  • Algorithm 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

五、SecureCRT 配置建议

  • 协议:SSH2
  • 端口:22
  • 用户名:普通用户(别直接用 root)
  • 字符编码:UTF-8

如果你能把 具体报错截图或文字 发出来,我可以直接告诉你哪一步错了。

0