hexpang/ssh-client

SSH客户端

v0.5.3 2016-08-26 19:10 UTC

This package is not auto-updated.

Last update: 2024-09-26 03:22:15 UTC


README

PHP的SSH客户端。

使用Composer安装

composer require hexpang/ssh-client

命名空间

hexpang\Client\SSHClient

要求

SSH2

用法

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!";
}

方法