解决ubuntu 20.04 Unable to negotiate with port 22: no matching key exchange method found问题

Ubunt 20.04 SSH 到一些Host或IP时,有时会出现这个的错误

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

网上的一些解决方法是加-o选项, 但是我老是记不信这个-o后面的一长串字串,Google时找到的另外一个方法:

echo "KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1" >>/etc/ssh/ssh_config.d/weak.conf

这里可能会有权限问题,那可以自己建立一个weak.conf文件,然后把KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1写在文件里保存便可。

参考文章在此: https://ubuntuforums.org/showthread.php?t=2441553

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容