SSH 错误:ssh_dispatch_run_fatal:连接到 192.168.xx 端口 22:DH GEX 组超出范围

SSH 错误:ssh_dispatch_run_fatal:连接到 192.168.xx 端口 22:DH GEX 组超出范围

我在使用 SSH 时遇到问题。我无法通过 SSH 进入服务器,因为 DH GEX 组超出范围

我的 ssh 版本:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.4,OpenSSL 1.0.2g 2016 年 3 月 1 日

我尝试通过 ssh 进入具有主机密钥算法的服务器:

[email protected],[email protected],hmac-md5,hmac-sha1,umac-64 @openssh.com,[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hma [email protected],hmac-sha1-96,hmac-md5-96 mac algo SC: [email protected],[email protected],umac-64-etm@open ssh.com,[email protected],[email protected],hmac-sha2-512-etm @openssh.com,[email protected],[email protected],hmac-md [email protected],hmac-md5,hmac-sha1,[email protected],[email protected] ,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1
-96,hmac-md5-96 comp algo CS: none,[email protected],zlib comp algo SC: none,[email protected],zlib

这是我的 ssh 调试:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/haniz/.ssh/config
debug3: kex names ok: [diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug3: kex names ok: [diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug2: resolving "192.168.150.136" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.150.136 [192.168.150.136] port 22.
debug1: Connection established.
debug1: identity file /home/haniz/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/haniz/.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-4ubuntu2.4
debug1: Remote protocol version 2.0, remote software version ROSSSH
debug1: no match: ROSSSH
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.150.136:22 as 'haniz'
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-dss
debug2: ciphers ctos: aes192-cbc,aes128-cbc,aes256-cbc,blowfish-cbc,3des-cbc
debug2: ciphers stoc: aes192-cbc,aes128-cbc,aes256-cbc,blowfish-cbc,3des-cbc
debug2: MACs ctos: hmac-sha1,hmac-md5
debug2: MACs stoc: hmac-sha1,hmac-md5
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: diffie-hellman-group-exchange-sha1
debug1: kex: host key algorithm: ssh-dss
debug1: kex: server->client cipher: aes128-cbc MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-cbc MAC: hmac-sha1 compression: none
debug3: send packet: type 34
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug3: receive packet: type 31
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
ssh_dispatch_run_fatal: Connection to 192.168.150.136 port 22: DH GEX group out of range

我该如何修复它?

谢谢阅读!

答案1

该问题有三种可能的解决方案。

  1. 在客户端,你应该升级新的 openssh7.2p

  2. 修改/etc/ssh/module(客户端)

从原点到目标:

如果您想通过 ssh 从新开放的 ssh 服务器连接到已弃用的服务器。只需尝试以下命令

ssh -v -o KexAlgorithms=diffie-hellman-group14-sha1 -o HostKeyAlgorithms=+ssh-dss my.linux.com

相关内容