Ubunt 20.04 SSH 到一些Host或IP時(shí)队萤,有時(shí)會(huì)出現(xiàn)這個(gè)的錯(cuò)誤
Unable to negotiate with xxx.xxx.xxx.xxx port 22: no matching key exchange method found. Their offer:diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
網(wǎng)上的一些解決方法是加-o選項(xiàng)衬以, 但是我老是記不信這個(gè)-o后面的一長串字串记餐,Google時(shí)找到的另外一個(gè)方法:
echo "KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1" >>/etc/ssh/ssh_config.d/weak.conf
這里可能會(huì)有權(quán)限問題技俐,那可以自己建立一個(gè)weak.conf文件惋耙,然后把KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1寫在文件里保存便可瞬铸。
參考文章在此: https://ubuntuforums.org/showthread.php?t=2441553