ssh_dispatch_run_fatal 未找到匹配的密钥交换方法(在 Zend Studio 远程连接上)

ssh_dispatch_run_fatal no matching key exchange method found (on Zend Studio Remote Connection)

我使用 MacBook OSX 作为本地计算机,使用 NoteBook lUbuntu 作为我本地网络上的服务器。 SSH 和 SFTP 连接与 osx 终端完美配合,但我在使用 Zend Studio 11 远程连接时遇到问题(不幸的是,我无法使用最新版本的 ZS...)。

我已经在本地网络上使用 lUbuntu 服务器设置了远程连接配置文件,其中包含本地 IP 地址、用户名和密码。然后,当我尝试测试连接时,它会 return 错误消息 "Failed to connect sshd on 192.168.###.##:##"

lUbuntu 服务器 auth.log 显示此消息:

Feb 15 16:09:08 ubuntu sshd[1907]: fatal: ssh_dispatch_run_fatal: Connection to 192.168.###.##: no matching key exchange method found [preauth]

顺便说一句,与其他远程网络和服务器的相同远程连接工作得很好......

那么,我该如何解决这个问题?

整个 auth.log 栈与 DEBUG3 LogLevel:

Feb 15 18:11:09 ubuntu sshd[2326]: debug1: Forked child 2411.
Feb 15 18:11:09 ubuntu sshd[2326]: debug3: send_rexec_state: entering fd = 8 config len 755
Feb 15 18:11:09 ubuntu sshd[2326]: debug3: ssh_msg_send: type 0
Feb 15 18:11:09 ubuntu sshd[2326]: debug3: send_rexec_state: done
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: oom_adjust_restore
Feb 15 18:11:09 ubuntu sshd[2411]: Set /proc/self/oom_score_adj to 0
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: inetd sockets after dupping: 3, 3
Feb 15 18:11:09 ubuntu sshd[2411]: Connection from 192.168.100.2 port 54472 on 192.168.100.14 port 22
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: Client protocol version 2.0; client software version JSCH-0.1.50
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: no match: JSCH-0.1.50
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: Enabling compatibility mode for protocol 2.0
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: Local version string SSH-2.0-OpenSSH_6.9p1 Ubuntu-2ubuntu0.1
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: fd 3 setting O_NONBLOCK
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: Network child is on pid 2412
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: preauth child monitor started
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: privsep user:group 112:65534 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: permanently_set_uid: 112/65534 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: SSH2_MSG_KEXINIT received [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: none,zlib@openssh.com [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: none,zlib@openssh.com [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit:  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit:  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: first_kex_follows 0  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: reserved 0  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: ssh-rsa,ssh-dss [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: none [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: none [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit:  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit:  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: first_kex_follows 0  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: reserved 0  [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: kex: client->server aes128-ctr hmac-sha1 none [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: kex: server->client aes128-ctr hmac-sha1 none [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: fatal: ssh_dispatch_run_fatal: Connection to 192.168.100.2: no matching key exchange method found [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: do_cleanup [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: PAM: sshpam_thread_cleanup entering [preauth]
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: monitor_read_log: child log fd closed
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: mm_request_receive entering
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: do_cleanup
Feb 15 18:11:09 ubuntu sshd[2411]: debug3: PAM: sshpam_thread_cleanup entering
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: Killing privsep child 2412
Feb 15 18:11:09 ubuntu sshd[2411]: debug1: audit_event: unhandled event 12

双方名单没有交集:

服务器:

Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [preauth]

客户:

Feb 15 18:11:09 ubuntu sshd[2411]: debug2: kex_parse_kexinit: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1 [preauth]

您应该尝试更新到当前的 JSCH 版本。 0.1.50 不是 latest one,在当前服务器上使用它存在一些问题。

如果这不是一个选项,您可以暂时将 kex 算法添加到服务器列表中,例如将一行添加到您的 /etc/ssh/sshd_config:

KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

然后重新启动您的 sshd 服务器:service sshd restart