定制 hexpang/ssh-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hexpang/ssh-client

最新稳定版本:v0.5.3

Composer 安装命令:

composer require hexpang/ssh-client

包简介

SSH Client

README 文档

README

SSH Client for PHP.

Build Status
[Build Status]

Install With Composer

composer require hexpang/ssh-client

Namespace

hexpang\Client\SSHClient

Require

SSH2

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-26