xshell4连接ubuntu20.04失败,提示“找不到匹配的key exchange算法“


xshell4连接ubuntu20.04失败,提示“找不到匹配的key exchange算法“

  本文链接:https://blog.csdn.net/qq_24814027/article/details/120944054    

对比ubuntu18.04,ubuntu20.04的key exchange算法
diffie-hellman-group14-sha1升级到了diffie-hellman-group14-sha256
xshell4版本估计不支持diffie-hellman-group14-sha256导致
在这里插入图片描述

解决方法:
增加ubuntu20.04 key excange算法diffie-hellman-group14-sha1,兼容xshell4

echo "KexAlgorithms +diffie-hellman-group14-sha1" >>/etc/ssh/sshd_config
systemctl restart sshd
##注意+号不能省略,+是追加算法
    sudo passed root

 

 

1:卸载openssh
sudo apt-get autoremove --purge openssh-server openssh-client

2:更新
sudo apt-get update

3:安装ssh服务端和客户端
sudo apt-get install openssh-server openssh-client

4:查看服务是否启动
ps -e|grep ssh

5:启动ssh
sudo service ssh start

6:若启动失败,了解错误原因
sshd -t

7:确认ssh-server已经正常工作
netstat -tlp