无法 ssh 进入 cisco 交换机:密钥长度无效

Meb*_*bus 6 cisco ssh switch legacy

由于某种原因,我无法通过 ssh 连接到 Cisco Catalyst C3750 交换机。这是我收到的错误消息:

   ssh_dispatch_run_fatal: Connection to 192.168.7.6 port 22: Invalid key length
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的 SSH 配置:

   Host 192.168.7.6
   IdentitiesOnly yes
   KexAlgorithms=+diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)

我的 SSH 版本是:

   OpenSSH_7.6p1, OpenSSL 1.1.0h-fips  27 Mar 2018
Run Code Online (Sandbox Code Playgroud)

我已经跑了:

   crypto key generate rsa
Run Code Online (Sandbox Code Playgroud)

在交换机上并生成了一个2048长度的密钥,但这没有帮助。我也重新加载了开关。

谢谢

小智 9

从 7.6 开始,openssh 拒绝密钥长度小于 1024 位。 https://www.openssh.com/txt/release-7.6

如果使用ubuntu,可以安装openssh-client-ssh1,然后使用ssh1命令代替ssh。

sudo apt install openssh-client-ssh1
Run Code Online (Sandbox Code Playgroud)

有时您需要使用密码向 ssh 命令指定参数 -c (例如 -c 3des-cbc)


小智 1

我进入我的:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc username@3750g
Run Code Online (Sandbox Code Playgroud)

它选择正确的密钥和密码。

查尔斯

  • 这不起作用并导致相同的错误。 (6认同)