php ssh2_connect,php – 警告:ssh2_connect():覆盖服务器到客户端COMP方法失败

这可能是libssh php5版本编译时出现的问题.在我的桌面上试过这个,并遇到了同样的问题.

> ssh -C -vv root@host.com

...

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug2: kex_parse_kexinit: diffie-hellman-group14-sha1

debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss

debug2: kex_parse_kexinit: aes128-ctr,aes256-ctr,arcfour256,arcfour

debug2: kex_parse_kexinit: aes128-ctr,aes256-ctr,arcfour256,arcfour

debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96

debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96

debug2: kex_parse_kexinit: zlib@openssh.com,zlib,none

debug2: kex_parse_kexinit: zlib@openssh.com,zlib,none

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit: first_kex_follows 0

debug2: kex_parse_kexinit: reserved 0

debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour

debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour

debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96

debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96

debug2: kex_parse_kexinit: none,zlib@openssh.com

debug2: kex_parse_kexinit: none,zlib@openssh.com

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit:

debug2: kex_parse_kexinit: first_kex_follows 0

debug2: kex_parse_kexinit: reserved 0

debug2: mac_setup: found hmac-sha1

debug1: kex: server->client aes128-ctr hmac-sha1 zlib@openssh.com

debug2: mac_setup: found hmac-sha1

debug1: kex: client->server aes128-ctr hmac-sha1 zlib@openssh.com

您可以看到我的客户端支持压缩方法zlib@openssh.com,zlib和none,而服务器仅支持zlib@openssh.com和none,因此密钥交换过程最终将使用zlib@openssh.com.

不幸的是,支持压缩类型zlib@openssh.com wasn’t added to libssh2 until 1.4.3和是,你猜对了,我的php5.4是用libssh 1.2.7编译的.

> phpinfo(INFO_MODULES);

....

ssh2

SSH2 support => enabled

extension version => 0.11.3-dev

libssh2 version => 1.2.7

banner => SSH-2.0-libssh2_1.2.7

remote forwarding => enabled

hostbased auth => enabled

polling support => enabled

publickey subsystem => enabled

TL; DR:如果WinSCP使用zlib@openssh.com作为压缩,请确保您的php是在libssh2 1.4.3编译的.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值