当前位置:Gxlcms > PHP教程 > PHPSSH2简单实例

PHPSSH2简单实例

时间:2021-07-01 10:21:17 帮助过:36人阅读

1.摘自:http://cn.php.com/

$connection = ssh2_connect ( 'shell.example.com' , 22 );
ssh2_auth_password ( $connection , 'username' , 'password' );

ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
?>

2.如果本地PHP不支持SSH2

摘自:http://www.asim.pk/2010/05/27/installing-phps-ssh2-extension-on-ubuntu/

sudo apt-get install libssh2-1-dev libssh2-php

重新启动apache

人气教程排行