hexpang/ssh-client
最新稳定版本:v0.5.3
Composer 安装命令:
composer require hexpang/ssh-client
包简介
SSH Client
关键字:
README 文档
README
SSH Client for PHP.
| Build Status |
|---|
| [ |
Install With Composer
composer require hexpang/ssh-client
Namespace
hexpang\Client\SSHClient
Require
Usage
require_once 'path_to/vendor/autoload.php';
use hexpang\Client\SSHClient\SSHClient;
$client = new SSHClient($host,$port,$username,$password);
if($client->ping($host,$port,10)){
if($client->connect() && $client->authorize()){
var_dump($client->cmd('ls -l'));
}else{
echo "Oops.";
}
}else{
echo "Ping Timeout!";
}
Method
| Method | Description | Usage |
|---|---|---|
| ping | Check port | $ssh->ping($host,$port,$timeOut) |
| connect | Connect to server | $ssh->connect() |
| authorize | Authorize | $ssh->authorize() |
| authorizeWithPK | Authorize With Public Key | $ssh->authorizeWithPK('id_rsa.pub','id_rsa','passphrase') |
| cmd | Execute command and response result for an array[ Response,Error ] | $ssh->cmd($command) |
| scp_send | Send file via SCP Protocol | $client->scp_send($local_file,$remote_file,$create_mode = 644) |
| scp_recv | Receive file via SCP Protocol | $client->scp_recv($remote_file,$local_file) |
| disconnect | Disconnect | $ssh->disconnect() |
统计信息
- 总下载量: 16.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-26