SecureCRT连接本地Windows子系统wsl的ubuntu已经安装ssh并且已经启动: 如图:
但是使用crt连接本地ubuntu报错:
Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
解决:
在ubuntu的ssh配置文件: /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,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
重启ssh服务即可:
相关命令
service ssh stop 关闭ssh服务
service ssh start 启动ssh服务
service ssh status 查看ssh服务启动情况