SecureCRT与Ubuntu的常见兼容性问题及解决方法
错误表现:连接时提示“Key exchange failed”“No compatible key exchange method”或“Unable to negotiate key exchange”。
原因:Ubuntu系统默认SSH服务(OpenSSH)启用了较新的密钥交换算法(如curve25519-sha256),而旧版SecureCRT不支持这些算法,导致双方无法协商一致的密钥交换方式。
解决方法:
/etc/ssh/sshd_config),添加以下参数以支持旧版SecureCRT的密钥交换方法:KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
HostKeyAlgorithms ssh-rsa,ssh-dss
保存后重启SSH服务:sudo systemctl restart sshd。错误表现:SecureCRT终端中显示的中文为乱码(如方框、问号或乱码字符)。
原因:SecureCRT终端的字符编码与Ubuntu系统的默认编码(通常为UTF-8)不一致。
解决方法:
打开SecureCRT,进入“选项”→“会话选项”→“外观”,将“字符编码”设置为“UTF-8”;同时选择支持中文的字体(如“Noto Sans CJK SC”“微软雅黑”或“SimSun”),保存后重新连接即可。
错误表现:连接时提示“Connection timed out”或无法建立连接。
原因:Ubuntu系统未安装SSH服务、SSH服务未启动,或防火墙阻止了SecureCRT的连接请求。
解决方法:
sudo apt update && sudo apt install openssh-server -y # 安装SSH服务
sudo systemctl start sshd # 启动SSH服务
sudo systemctl enable sshd # 设置开机自启
sudo ufw disable
ping <Ubuntu_IP>测试连通性。错误表现:旧版SecureCRT(如8.0及以下版本)无法连接Ubuntu 22.04及以上版本,提示“Unsupported protocol”“Invalid key exchange method”等。
原因:Ubuntu 22.04及以上版本默认使用OpenSSH 8.9及以上版本,移除了对旧版SSH协议(如SSH1)和密钥交换算法的支持,而旧版SecureCRT未适配这些变更。
解决方法:
错误表现:通过串口连接Ubuntu时,提示“Permission denied”或无法打开串口设备(如/dev/ttyUSB0)。
原因:Ubuntu系统对串口设备的访问权限进行了限制,默认只有root用户或dialout组成员可以访问。
解决方法:
dialout组:sudo usermod -aG dialout $USER