从 Cisco 路由器到 Dell 交换机的 SSH 失败

网络工程 思科 SSH 戴尔
2022-03-03 05:10:12

遇到两个不同但可能相似的问题。

首要问题 -

我在固件 v15.2(4)M4 上有两个 Cisco 2900 系列路由器,试图通过 ssh 连接到固件 v4.1.0.8 上的戴尔 5548P 堆栈。所有尝试都会立即失败 -

router#ssh 1.2.3.4
[Connection to 1.2.3.4 aborted: error status 0]

缓冲区日志显示 -

SSH2 CLIENT 0: Server has chosen 2056 -bit dh keys
%SSH-3-INV_MOD: Invalid modulus length

如果我尝试修改路由器上的 DH 密钥长度,尝试仍然失败并且缓冲区日志显示 -

SSH2 CLIENT 0: Server has chosen 2056 -bit dh keys
%SSH-3-INV_MOD: Invalid modulus length  
%SSH-3-DH_RANGE_FAIL: Client DH key range mismatch with maximum configured DH key on server

路由器上的 SSH 配置 -

SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3
Minimum expected Diffie Hellman key size : 1024 bits
IOS Keys in SECSH format(ssh-rsa, base64 encoded):
ssh-rsa keystringgoeshere

5548P 堆栈上的 SSH 配置 -

SSH Server enabled. Port: 22
RSA key was generated.
DSA(DSS) key was generated.
SSH Public Key Authentication is disabled.

这里似乎没有我可以修改的与 ssh 服务器相关的任何深入设置。

--

第二期——

我在固件 v15.4(3)M3 的不同站点上还有另外两台 Cisco 2900 系列路由器试图通过固件 v6.3.0.6 连接到戴尔 N1548P 堆栈。所有尝试都失败 -

router#ssh 5.6.7.8
Password:
[Connection to 5.6.7.8 aborted: error status 0]

缓冲区日志显示 -

SSH2 CLIENT 0:  Channel open failed, reason = 1752134516

路由器上的 SSH 配置 -

SSH Enabled - version 2.0
Authentication methods:publickey,keyboard-interactive,password
Encryption Algorithms:aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
MAC Algorithms:hmac-sha1,hmac-sha1-96
Authentication timeout: 120 secs; Authentication retries: 3
Minimum expected Diffie Hellman key size : 1024 bits
IOS Keys in SECSH format(ssh-rsa, base64 encoded):
ssh-rsa keystringgoeshere

N1548P 堆栈上的 SSH 配置 -

SSH Server enabled.  Port: 22
Protocol Levels: Versions 1 and 2.
SSH Connections Currently in Use: ............. 1
Maximum number of SSH Sessions Allowed: ....... 5
SSH Session Timeout: .......................... 600
RSA key was generated.
DSA key was generated.
SSH Public Key Authentication is disabled.

在这种特殊情况下,如果我修改路由器以使用 SSH v1,它就能够连接。使用 v2,它不是。当然,我们不想使用 v1。我一直无法弄清楚“1752134516”是什么意思。

--

请注意,我可以直接通过 SSH 连接到两个交换机堆栈。只有路由器无法连接。

谢谢你的帮助。

2个回答

请尝试通过此命令更改大小

ip ssh dh 最小大小 2048

否则 2048 可以更改为您所需的模块长度

关于固件 v6.3.0.6 上的 Dell N1548P 堆栈和

SSH2 CLIENT 0:  Channel open failed, reason = 1752134516

确保它没有运行 OpenSSH v6.9。此处描述的 Cisco 和 OpenSSH 6.9 存在问题

原来问题是在用户身份验证后向客户端发送主机密钥的新协议扩展(PROTOCOLS 文档的第 2.5 节)。注释掉 sshd.c 中的 notify_hostkeys() 调用修复了 Cisco scp 的问题。可能是为了添加到 6.9 中添加的“Cisco-1.*”客户端字符串中的新错误兼容性标志?

已在 OpenSSH v7.0 中修复