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. [HTTP &amp; Networking](/categories/http)
4. /
5. hexpang/ssh-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

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

SSH Client

v0.5.3(9y ago)617.6k↓65.4%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 3w 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 62% 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

3587d 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

[php-http/httplug

HTTPlug, the HTTP client abstraction for PHP

2.6k319.6M739](/packages/php-http-httplug)[php-http/discovery

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

1.3k325.3M1.5k](/packages/php-http-discovery)[php-http/client-common

Common HTTP Client implementations and tools for HTTPlug

1.1k233.5M624](/packages/php-http-client-common)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78127.2M452](/packages/react-http)[mashape/unirest-php

Unirest PHP

1.3k9.9M163](/packages/mashape-unirest-php)[smi2/phpclickhouse

PHP ClickHouse Client

84711.1M79](/packages/smi2-phpclickhouse)

PHPackages © 2026

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