首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >DH GEX群超出范围

DH GEX群超出范围
EN

Server Fault用户
提问于 2016-06-27 21:13:13
回答 2查看 37.8K关注 0票数 10

我的服务器突然出现了SSHing问题:

代码语言:javascript
运行
复制
ssh -v --@--
OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /home/paul/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to -- [--] port 22.
debug1: Connection established.
debug1: identity file /home/paul/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/paul/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1
debug1: Remote protocol version 1.99, remote software version OpenSSH_6.6.1p1
debug1: match: OpenSSH_6.6.1p1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to --:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha1
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-cbc MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-cbc MAC: hmac-sha1 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
ssh_dispatch_run_fatal: Connection to -- port 22: DH GEX group out of range

我已经广泛地阅读了这个问题,宋承宪:卫生署_GEX群超出范围,但是它似乎没有回答这个问题。我控制着客户机和服务器,它们都使用普通的OpenSSH和Ubuntu。没有第三方。错误似乎也有点不同,它不是抱怨比特大小。

EN

回答 2

Server Fault用户

回答已采纳

发布于 2016-06-28 00:11:10

看起来,您正在针对旧的OpenSSH服务器(OpenSSH 6.6.1p1)运行一个较新的OpenSSH客户端(OpenSSH 7.2p2)。在OpenSSH 7.1p2发行说明中,它提到:

  • ssh(1),sshd(8):将diffie-hellman群交换支持的最小模数大小增加到2048位。

从报告的错误消息来看,似乎是您的客户拒绝了_server提供的DH组交换值。

因此,我想知道,“突然出现的问题”是否发生在您的客户端计算机应用了一些包/更新的时候。

根据这个描述了一个非常类似的问题的,“解决方案”可能是:( a)修改服务器端的/etc/ssh/moduli文件,使服务器不使用小于2048位的DH组,或者( b)将服务器升级到OpenSSH 7.1p2或更高版本。

票数 7
EN

Server Fault用户

发布于 2016-10-14 15:25:32

如果要使用较新的OpenSSH连接到不推荐的服务器:

代码语言:javascript
运行
复制
ssh -o KexAlgorithms=diffie-hellman-group14-sha1 -o HostKeyAlgorithms=+ssh-dss my.host.com

如果您想查看正在发生的事情,请添加-v,如果-o HostKeyAlgorithms=ssh仍然不能工作,则添加它:

代码语言:javascript
运行
复制
ssh -v -o HostKeyAlgorithms=ssh-dss -o KexAlgorithms=diffie-hellman-group14-sha1 my.host.com

当然,您还可以编辑/etc/ssh/ssh_config或~/.ssh/ssh_config,并添加:

代码语言:javascript
运行
复制
Host my.host.com *.myinsecure.net 192.168.1.* 192.168.2.*
    HostKeyAlgorithms ssh-dss
    KexAlgorithms diffie-hellman-group1-sha1    

https://forum.ctwug.za.net/t/fyi-openssh-to-access-rbs-openssh-7/6069提到了Mikrotik上的以下修复:

代码语言:javascript
运行
复制
/ip ssh set strong-crypto=yes

(在这里注意到这一点,因为在寻找类似的错误消息时,这个答案也会出现在web搜索中。)

如果您想在不编辑ssh_config或更新SSH服务器的情况下在Git上使用它:

代码语言:javascript
运行
复制
GIT_SSH="ssh -oHostKeyAlgorithms=+ssh-dss -oKexAlgorithms=diffie-hellman-group14-sha1" git clone ssh://user@host/path-to-repository
票数 10
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/786587

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档