SecureCRT与Debian的兼容性排查与修复
一 快速定位思路
二 常见报错与对应修复
密钥交换失败 Key exchange failed / No compatible key exchange method
服务端编辑**/etc/ssh/sshd_config**,在末尾补充较通用的算法列表并重启服务:
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
sudo systemctl restart sshd
客户端在Session Options → Connection → SSH → Key Exchange勾选与服务器匹配的算法;同时优先升级SecureCRT到最新版本以获得更好的算法支持。
连接超时 Connection timed out
核对网络与端口:ping 目标IP,确认路由/安全组/ACL未拦截;确认服务监听:sudo systemctl status ssh;检查防火墙:sudo ufw status、sudo ufw allow ssh(或 firewalld/iptables 放行22);必要时抓包或改用同网段测试。
认证失败 Permission denied (publickey,password)
临时开启密码登录用于排查:编辑**/etc/ssh/sshd_config**,确保PubkeyAuthentication yes与PasswordAuthentication yes,重启sshd;确认用户家目录与**.ssh/authorized_keys**权限正确(600/700);本地生成密钥:ssh-keygen -t rsa -b 4096,使用ssh-copy-id部署公钥。
中文乱码
客户端设置:Options → Session Options → Appearance → Character encoding = UTF-8;确保服务器与终端环境使用一致的LANG/LC_CTYPE(如 en_US.UTF-8/zh_CN.UTF-8)。
三 配置与加固建议
四 仍无法解决时的高效求助方式