PHPackages                             hexpang/ssh-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hexpang/ssh-client

ActiveLibrary

hexpang/ssh-client
==================

SSH Client

v0.5.3(9y ago)617.0k↑61.2%MITPHPPHP &gt;=5.5

Since Aug 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/HexPang/ssh-client)[ Packagist](https://packagist.org/packages/hexpang/ssh-client)[ Docs](https://github.com/hexpang/ssh-client)[ RSS](/packages/hexpang-ssh-client/feed)WikiDiscussions v0.5 Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

SSH Client For PHP
==================

[](#ssh-client-for-php)

SSH Client for PHP.

Build Status\[[![Build Status](https://camo.githubusercontent.com/d61f29dfc560707c0054d4c4808360426079a2ce7a24c03281f506702db7e6a9/68747470733a2f2f636972636c6563692e636f6d2f67682f48657850616e672f7373682d636c69656e742e706e673f636972636c652d746f6b656e3d37623039623936306362623164646666313763386439336363663764623434383334353639353134)](https://camo.githubusercontent.com/d61f29dfc560707c0054d4c4808360426079a2ce7a24c03281f506702db7e6a9/68747470733a2f2f636972636c6563692e636f6d2f67682f48657850616e672f7373682d636c69656e742e706e673f636972636c652d746f6b656e3d37623039623936306362623164646666313763386439336363663764623434383334353639353134)\]Install With Composer
---------------------

[](#install-with-composer)

> composer require hexpang/ssh-client

Namespace
---------

[](#namespace)

> hexpang\\Client\\SSHClient

Require
-------

[](#require)

> [SSH2](https://pecl.php.net/package/ssh2)

Usage
-----

[](#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)

MethodDescriptionUsagepingCheck port$ssh-&gt;ping($host,$port,$timeOut)connectConnect to server$ssh-&gt;connect()authorizeAuthorize$ssh-&gt;authorize()authorizeWithPKAuthorize With Public Key$ssh-&gt;authorizeWithPK('id\_rsa.pub','id\_rsa','passphrase')cmdExecute command and response result for an array\[ Response,Error \]$ssh-&gt;cmd($command)scp\_sendSend file via SCP Protocol$client-&gt;scp\_send($local\_file,$remote\_file,$create\_mode = 644)scp\_recvReceive file via SCP Protocol$client-&gt;scp\_recv($remote\_file,$local\_file)disconnectDisconnect$ssh-&gt;disconnect()

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3542d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b09b05537f987fc8603680e1b6b8bcc023e47ff4d0b3df2445f9e82df4af4c1?d=identicon)[HexPang](/maintainers/HexPang)

---

Top Contributors

[![HexPang](https://avatars.githubusercontent.com/u/1132194?v=4)](https://github.com/HexPang "HexPang (1 commits)")

---

Tags

clientsshssh-client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hexpang-ssh-client/health.svg)

```
[![Health](https://phpackages.com/badges/hexpang-ssh-client/health.svg)](https://phpackages.com/packages/hexpang-ssh-client)
```

###  Alternatives

[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.4k991.0M30.9k](/packages/guzzlehttp-guzzle)[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M937](/packages/elasticsearch-elasticsearch)[php-http/httplug

HTTPlug, the HTTP client abstraction for PHP

2.6k307.6M679](/packages/php-http-httplug)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
