gpt4 book ai didi

php - 在 CentOS5 上禁用不推荐使用的密码后,如何使用 PHP 执行 SFTP 操作?

转载 作者:行者123 更新时间:2023-12-02 14:28:43 25 4
gpt4 key购买 nike

我有用于 SFTP 操作的 PHP 代码,目前在 CentOS5 机器上运行良好。
禁用以下不推荐使用的密码后,它停止工作。

这是密码列表

key 交换:diffie-hellman-group1-sha1
密码:arcfour256、arcfour128、3DES-cbc、blowfish-cbc、cast128-cbc、arcfour

这是当前的代码片段

$connection = ssh2_connect('ftp_url', 'ftp_port');

最佳答案

这行得通。这种方法实际上强制代码使用指定的密码

$methods = array(
'hostkey' => 'ssh-rsa,ssh-dss',
'client_to_server' => array(
'crypt' => 'aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'
),
'server_to_client' => array(
'crypt' => 'aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'
)
);

$connection = ssh2_connect( 'ftp_url', 'ftp_port', $methods );

关于php - 在 CentOS5 上禁用不推荐使用的密码后,如何使用 PHP 执行 SFTP 操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58381116/

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