首页 > 其他分享 >Openssh升级导致堡垒机无法连接

Openssh升级导致堡垒机无法连接

时间:2022-08-17 15:17:54浏览次数:61  
标签:sha1 hellman Openssh 堡垒 group1 ssh 服务器 diffie 连接

现象描述

由于Diffie-Hellman Key Agreement Protocol 漏洞,需要对服务器SSH版本进行升级
将Openssh版本升级到8.5后,操作系统出现如下告警,无法通过堡垒机进行远程连接

# 报错信息
Unable to negotiate with 192.168.1.101 port 29418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

问题原因

OpenSSH 7.0 弃用了 diffie-hellman-group1-sha1 密钥算法,因为它很弱并且在所谓的 Logjam 攻击的理论范围内。
如果客户端和服务器无法就一组相互的参数达成一致,则连接将失败。OpenSSH(7.0 及更高版本)将产生如下错误消息:

# 报错信息
Unable to negotiate with 192.168.1.101 port 29418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

在这种情况下,客户端和服务器无法就密钥交换算法达成一致,因为服务器只提供了一种方法 diffie-hellman-group1-sha1。

修复方案

  • 客户端远程时强制指定ssh使用旧版本的key
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@host
  • 在 ~/.ssh/config 文件中配置如下代码
Host *
    KexAlgorithms +diffie-hellman-group1-sha1
  • 在修改/etc/ssh/ssh_config文件,在最末尾加入如下代码
KexAlgorithms +diffie-hellman-group1-sha1  # 按照报错信息添加算法

标签:sha1,hellman,Openssh,堡垒,group1,ssh,服务器,diffie,连接
From: https://www.cnblogs.com/Lz-heng/p/16595240.html

相关文章