apt-get install libssh2-1-dev libssh2-php
service apache2 restart

安装完成之后,可以使用SCP远程复制文件:
$connection = ssh2_connect("192.168.1.1",22);
if(ssh2_auth_password($connection,"aaa","pass"))
{
echo "Authentication Successful! ";
}else{
die("Authentication Failed...");
}

$ret = ssh2_scp_send($connection,'/var/www/aaa', '/var/www/aaa');

posted on 2016-04-17 21:17  饭前码字  阅读(2938)  评论(0编辑  收藏  举报