xshell4連接ubuntu20.04失敗,提示“找不到匹配的key exchange算法“ 以及 ubuntu 安裝ssh


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

 

對比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
##注意+號不能省略,+是追加算法

 

 

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

 

 

 

確定服務器可以上網
apt源配置完畢

安裝ssh

使用apt安裝openssh服務。

 
sudo  apt-get install openssh-server 

啟動ssh

 
root@cka01:~# sudo /etc/init.d/ssh start #確定22端口存在並存活 root@cka01:~# ss -tnl | grep 22 LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 [::]:22 [::]:* 

配置ssh root登錄

編輯配置文件,讓其支持root用戶登錄,因為默認是不支持root用戶的。

 
sudo vim /etc/ssh/sshd_config

把其中的“PermitRootLogin prohibit-password” 修改為“PermitRootLogin yes”。


 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM