我正在尝试连接到我的SFTP服务器(prosftpd),但当我查看其日志时,我发现:
2018-04-19 11:00:48,303 mod_sftp / 0.9.9 [18488]:找不到共享的客户端到服务器MAC算法(客户端发送'hmac-sha1,hmac-sha1-96,hmac-md5,hmac- md5-96,hmac-ripemd160,hmac-ripemd160 @ openssh.com',服务器发送'hmac-sha2-256,hmac-sha2-512,umac-64 @ openssh.com')
我试着使用“方法”参数:
ssh2_connect("my-sftp-server.com", 443, array(
"client_to_server" => array(
"mac" => 'hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com'
但它不起作用,似乎这个算法不受方法 ssh2_connect
支持,在我的日志上我可以看到
客户发送'hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160 @ openssh.com'
有没有办法在我的PHP SFTP客户端上安装新的MAC算法?
1 回答
PHP SSH2 package使用libssh2 library .
对于
hmac-sha2-256
和hmac-sha2-512
,您需要libssh2 version 1.7.0(2016-02-23)或更高版本 . 没有支持umac-64@openssh.com
.或者,您可以使用phpseclib,自version 0.3.8(2014-09-12)以来支持
hmac-sha2-256
. 不支持hmac-sha2-512
,也不支持umac-64@openssh.com
.