gpt4 book ai didi

macos - JSch 算法与 OSX El Capitan 协商失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:20:08 24 4
gpt4 key购买 nike

我们有一个使用 Ant <scp> 的构建脚本将文件上传到 Mac 服务器的任务。在运行 OSX 10.8 (Mountain Lion) 的服务器上,这已经运行了一年或更长时间,但我们最近将其升级到 OSX 10.11 (El Capitan),现在是 <scp>。任务失败并出现此异常:

com.jcraft.jsch.JSchException: Algorithm negotiation fail

打开详细模式,日志如下所示:

[scp] Connecting to **SERVER-ADDRESS**:2220
[scp] Connecting to **SERVER-ADDRESS** port 2220
[scp] Connection established
[scp] Remote version string: SSH-2.0-OpenSSH_6.9
[scp] Local version string: SSH-2.0-JSCH-0.1.51
[scp] CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
[scp] CheckKexes: diffie-hellman-group14-sha1
[scp] diffie-hellman-group14-sha1 is not available.
[scp] SSH_MSG_KEXINIT sent
[scp] SSH_MSG_KEXINIT received
[scp] kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[scp] kex: server: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519
[scp] kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[scp] kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
[scp] kex: server: 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
[scp] kex: server: 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
[scp] kex: server: none,zlib@openssh.com
[scp] kex: server: none,zlib@openssh.com
[scp] kex: server:
[scp] kex: server:
[scp] kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
[scp] kex: client: ssh-rsa,ssh-dss
[scp] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
[scp] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
[scp] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[scp] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
[scp] kex: client: none
[scp] kex: client: none
[scp] kex: client:
[scp] kex: client:
[scp] Disconnecting from **SERVER-ADDRESS** port 2220

所以问题是客户端和服务器都不支持单一算法,正如这篇类似的 SO 帖子中所讨论的:JSchException: Algorithm negotiation fail和其他各种地方。但是,从日志来看,在我看来,客户端和服务器确实都支持至少一种算法,即“aes128-ctr”:

[scp] kex: server: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com

[scp] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc

所以我不明白为什么他们不能协商算法,但即便如此我还是继续安装了 JCE Unlimited Strength Jurisdiction Policy 文件,正如其他 SO 问题中所建议的那样 - 你可以在上面的行中看到客户端现在支持256位算法。这没有什么区别,大概是因为服务器支持“aes256-ctr”而客户端支持“aes256-cbc”。但是我还是不明白为什么它不能使用“aes128-ctr”

请注意,客户端机器运行的是 Windows,因此根据我在其他地方读到的内容(不记得确切的位置),我也尝试清除 Putty 的 SSH key 缓存 - 这也没有任何区别(不是我所期待的)它到 - 我现在只是在尝试一些东西......)

令人沮丧的是,它看起来像这个 SO post - Algorithm negotiation fail deploying iOS app in OSX "El Capitan" - 处理相同的问题,并且有一个解决方案,但回答者只是说问题已在他的产品中修复,而没有解释修复的内容,而且我没有足够的声誉来发表评论要求更多细节

最佳答案

算法协商不仅涉及密码,还涉及 key 交换和MAC。您没有任何通用的 key 交换算法:

[scp] kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
[scp] kex: client: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1

客户集真的很小。您可能必须在客户端允许额外的 Kex 方法。

关于macos - JSch 算法与 OSX El Capitan 协商失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35114068/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com