避免SecureCRT连接Ubuntu被拒绝,可从以下方面排查解决:
检查基础服务与网络
sudo systemctl status ssh # 检查状态
sudo systemctl start ssh # 启动服务
sudo ufw allow 22/tcp # 开放防火墙端口(若使用ufw)
ping
或telnet
测试目标主机端口。验证连接配置
~/.ssh/authorized_keys
权限为600
。调整SSH配置文件
/etc/ssh/sshd_config
,添加以下配置:HostKeyAlgorithms +ssh-rsa,ssh-dss
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,...
保存后重启SSH服务:sudo systemctl restart sshd
。其他注意事项
sshd_config
中设置PasswordAuthentication no
,但需确保公钥配置正确。按以上步骤逐一排查,可有效避免连接被拒绝的问题。