尝试连接时 OpenSSH 索引超出范围

尝试连接时 OpenSSH 索引超出范围

我正在尝试使用以下命令连接到我无法控制的 SSH 服务器:

ssh -v [email protected] -p 12345

以前,此命令适用于带有 OpenSSH 版本 6.6 的 Ubuntu 14.04。输出为:

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 12.34.56.78 [12.34.56.78] port 1234.
debug1: Connection established.
debug1: identity file /home/awesomeuser/.ssh/id_rsa type 1
debug1: identity file /home/awesomeuser/.ssh/id_rsa-cert type -1
debug1: identity file /home/awesomeuser/.ssh/id_dsa type -1
debug1: identity file /home/awesomeuser/.ssh/id_dsa-cert type -1
debug1: identity file /home/awesomeuser/.ssh/id_ecdsa type -1
debug1: identity file /home/awesomeuser/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/awesomeuser/.ssh/id_ed25519 type -1
debug1: identity file /home/awesomeuser/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7
debug1: Remote protocol version 2.0, remote software version Unknown_1.0.0
debug1: no match: Unknown_1.0.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 91:d9:c6:a4:84:3f:2a:6f:6d:d6:10:73:0b:4f:a8:d4
debug1: Host '[12.34.56.78]:1234' is known and matches the RSA host key.
debug1: Found key in /home/awesomeuser/.ssh/known_hosts:14
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
Welcome!debug1: Authentications that can continue: password,publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/awesomeuser/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: password
debug1: Next authentication method: password
[email protected]'s password:

我最近将我的机器升级到 Ubuntu 16.04,并使用 OpenSSH 版本 7.2。然后我收到一个错误:

OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 12.34.56.78 [12.34.56.78] port 12345.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/awesomeuser/.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 2.0, remote software version Unknown_1.0.0
debug1: no match: Unknown_1.0.0
debug1: Authenticating to 12.34.56.78:12345 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<8192<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
Received disconnect from 12.34.56.78 port 12345:2: Index was outside the bounds of the array.
Disconnected from 12.34.56.78 port 12345

有没有办法解决这个问题,而无需降级到 OpenSSH 6.6?

答案1

我已经找到解决上述问题的方法,即使用 PuTTY Unix 端口附带的实用程序套件。

sudo apt-get install plink

plink [email protected] -P 12345

相关内容