AIX 更新至 7.1.102.1100 后,ssh rsa 密钥登录无法通过 ssh 连接到 Cisco 设备(协议错误:预期数据包类型 50,结果为 106)-OpenSSH_7.5p1

AIX 更新至 7.1.102.1100 后,ssh rsa 密钥登录无法通过 ssh 连接到 Cisco 设备(协议错误:预期数据包类型 50,结果为 106)-OpenSSH_7.5p1

将 OpenSSH 更新到新版本后,我无法使用补丁之前可以使用的 RSA 密钥登录任何 Cisco 设备。我仍然可以使用 RSA 密钥顺利登录 Cisco Nexus,但所有其他设备都失败了。有人可以帮我修复吗?OpenSSH_7.5p1

bash-4.3$ ssh -vvv etc-rcore-1 OpenSSH_7.5p1, OpenSSL 1.0.2p 14 Aug 2018 debug1: Reading configuration data /home/e338wj/.ssh/config debug3: kex names ok: [diffie-hellman-group1-sha1] debug3: kex names ok: [diffie-hellman-group1-sha1] debug3: kex names ok: [diffie-hellman-group1-sha1] debug1: Reading configuration data /etc/ssh/ssh_config debug1: Failed dlopen: /usr/krb5/lib/libkrb5.a(libkrb5.a.so): Could not load module /usr/krb5/lib/libkrb5.a(libkrb5.a.so). System error: No such file or directory debug1: Error loading Kerberos, disabling Kerberos auth. debug2: resolving "etc-rcore-1" port 22 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to etc-rcore-1 [172.28.5.1] port 22. debug1: Connection established. debug1: identity file /home/e338wj/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/e338wj/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.5 debug1: Remote protocol version 2.0, remote software version Cisco-1.25 debug1: match: Cisco-1.25 pat Cisco-1.* compat 0x60000000 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to etc-rcore-1:22 as 'e338wj' debug3: hostkeys_foreach: reading file "/home/e338wj/.ssh/known_hosts" debug3: record_hostkey: found key type RSA in file /home/e338wj/.ssh/known_hosts:17 debug3: load_hostkeys: loaded 1 keys from etc-rcore-1 (emitted email lines for spam filter) 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 (emitted email lines for spam filter) debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128 debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128 (omitted email lines for spam filter) 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-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: host key algorithms: ssh-rsa debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc debug2: MACs ctos: hmac-sha1,hmac-sha1-96 debug2: MACs stoc: hmac-sha1,hmac-sha1-96 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-rsa debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none debug3: send packet: type 34 debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<4096<8192) sent debug3: receive packet: type 31 debug1: got SSH2_MSG_KEX_DH_GEX_GROUP debug2: bits set: 2060/4096 debug3: send packet: type 32 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug3: receive packet: type 33 debug1: got SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: ssh-rsa SHA256:xxx debug3: hostkeys_foreach: reading file "/home/e338wj/.ssh/known_hosts" debug3: record_hostkey: found key type RSA in file /home/e338wj/.ssh/known_hosts:17 debug3: load_hostkeys: loaded 1 keys from etc-rcore-1 debug1: Host 'etc-rcore-1' is known and matches the RSA host key. debug1: Found key in /home/e338wj/.ssh/known_hosts:17 debug2: bits set: 2076/4096 debug3: send packet: type 21 debug2: set_newkeys: mode 1 debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug3: receive packet: type 21 debug1: SSH2_MSG_NEWKEYS received debug2: set_newkeys: mode 0 debug1: rekey after 4294967296 blocks debug2: key: /home/e338wj/.ssh/id_rsa (200a1a88) debug2: key: /home/e338wj/.ssh/id_dsa (0) debug2: key: /home/e338wj/.ssh/id_ecdsa (0) debug2: key: /home/e338wj/.ssh/id_ed25519 (0) debug3: send packet: type 5 debug3: receive packet: type 6 debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug3: send packet: type 50 debug3: receive packet: type 53 debug3: input_userauth_banner debug3: receive packet: type 51 debug1: Authentications that can continue: publickey,keyboard-interactive,password debug3: start over, passed a different list publickey,keyboard-interactive,password debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/e338wj/.ssh/id_rsa debug3: send_pubkey_test debug3: send packet: type 50 debug2: we sent a publickey packet, wait for reply debug3: receive packet: type 60 debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: fp SHA256:xxx debug3: sign_and_send_pubkey: RSA SHA256:xxx debug3: send packet: type 106 debug1: Sent ALLOW_PKCS12_KEYSTORE_CLIENT_FLAG packet debug3: send packet: type 50 debug3: receive packet: type 1 Received disconnect from 172.28.5.1 port 22:2: Protocol error: expected packet type 50, got 106 Authentication failed.

答案1

这显然是由 IBM AIX 特定于 OpenSSH 的附加功能引起的,它会向解锁EFS无需与服务器事先达成协议。(我在其他论坛帖子中发现了这一点:123

(AIX OpenSSH 可能会这样做,因为根据RFC 4253 第 11.4 节,它指定服务器应该只通知客户端无法识别消息类型。然而,在实践中,许多 SSH 服务器软件决定对无法识别的消息采取更加严格的措施。

要通过 ~/.ssh/config 禁用此功能,请使用:

AllowPKCS12keystoreAutoOpen no

相关内容