麒麟桌面系统,ssh连接交换机失败,密钥算法不匹配

<p><strong/></p><p><strong><strong>【现象】</strong></strong></p><p>打开终端,用ssh命令连接交换机:
</p><pre>ssh   xxx@192.168.13.3</pre><p>提示:</p><pre>Unable to negotiate with 192.168.13.3 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1</pre><p>翻译过来就是:</p><p>SSH 客户端和服务器在协商连接参数时失败,客户端和服务器没有共同的密钥交换算法,服务器支持的密钥交换算法是 <strong>diffie-hellman-group14-sha1</strong>,但客户端不支持该算法。</p><p class="image-package">如下图所示:<img class="uploaded-img" src="https://upload-images.jianshu.io/upload_images/18579221-0f41a009c8c9978d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width="auto" height="auto"/></p><p><strong/></p><p><strong><strong>
</strong></strong></p><p><strong><strong>【处理】</strong></strong></p><p>编辑配置文件:<strong>vim  ~/.ssh/config</strong>,添加以下内容,以支持diffie-hellman-group14-sha1密钥算法。</p><pre>#以下ip地址按实际修改
Host   192.168.13.3
    KexAlgorithms   +diffie-hellman-group14-sha1</pre><p class="image-package">保存并退出(<strong>按esc键后,再输入:wq  ,按回车即可保存并退出vim</strong>)
再重新连接交换机,就正常了,用客户端软件连接也是一样。<img class="uploaded-img" src="https://upload-images.jianshu.io/upload_images/18579221-511c253fb97af01d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width="auto" height="auto"/></p><p><strong><strong>【原因分析】</strong></strong></p><p><strong/></p><ul><li><p>交换机可能配置了较老的 SSH 协议版本(如 SSHv1)或较弱的密钥交换算法(如 diffie-hellman-group1-sha1)</p></li><li><p>现代 SSH 客户端默认禁用较弱的算法(如 diffie-hellman-group1-sha1),而交换机可能仅支持这些算法。</p></li><li><p>如果可以请尽量升级ssh服务端的密钥算法,以提高安全性。</p></li></ul><p>
</p>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容