首頁 >後端開發 >php教程 >PHP SSH2简单实例

PHP SSH2简单实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-23 14:28:562279瀏覽

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

$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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn