SecureCRT 在 Ubuntu 上“连不上”通常有多种原因,下面按最常见 → 较少见的顺序帮你排查。你可以逐条对照:
不同现象对应不同原因:
Ubuntu 默认 不装 / 不启 SSH
# 查看是否安装
dpkg -l | grep openssh-server
# 没装就装
sudo apt update
sudo apt install openssh-server
# 启动并设置开机自启
sudo systemctl enable --now ssh
确认监听:
sudo netstat -tlnp | grep :22
# 或
ss -tlnp | grep ssh
ip a
确保 SecureCRT 填的是 正确的 IP
sudo ufw status
如果开启:
sudo ufw allow 22
检查:
默认:
PermitRootLogin no
如果你用 root 连:
sudo vim /etc/ssh/sshd_config
PermitRootLogin yes
sudo systemctl restart ssh
grep PasswordAuthentication /etc/ssh/sshd_config
如果是 no,密码登录会被拒绝。
在 Ubuntu 上执行:
systemctl status ssh
ip a
sudo ufw status
在 Windows / 宿主机:
ping <ubuntu_ip>
telnet <ubuntu_ip> 22
你可以告诉我:
我可以直接帮你一步步排到能连上为止。