PHPackages                             ssh-client/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ssh-client/ssh-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

Invoke OpenSSH from PHP.

0.1.6(9y ago)05.1k5MITPHPCI failing

Since Apr 28Pushed 9y ago3 watchersCompare

[ Source](https://github.com/linkorb/ssh-client)[ Packagist](https://packagist.org/packages/ssh-client/ssh-client)[ RSS](/packages/ssh-client-ssh-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (9)Used By (5)

Invoke OpenSSH from PHP.

```
$ cat example.php
require_once 'path/to/vendor/autoload.php';

use SSHClient\ClientConfiguration\ClientConfiguration;
use SSHClient\ClientBuilder\ClientBuilder;

# Create a config for the target host

$config = new ClientConfiguration('myhost.example.com', 'boite');
$config->setOptions(array(
    'IdentityFile' => '~/.ssh/id_ed25519',
    'IdentitiesOnly' => 'yes',
));

# Use the config to create a client builder for the target host

$builder = new ClientBuilder($config);

# build a Secure Copy client and copy some files to the target host

$config->setSCPOptions(array('r'));
$scp_client = $builder->buildSecureCopyClient();
$scp_client->copy(
    'path/to/somedir',
    $scp_client->getRemotePath('~/')
);

# build an SSH client and run a command on the target host

$ssh_client = $builder->buildClient();
print($ssh_client->exec(array('cat', '~/somedir/test.txt'))->getOutput());
# end example.php

$ mkdir -p path/to/somedir
$ echo "Let's perform a quirkafleeg." > path/to/somedir/test.txt
$ php example.php
Let's perform a quirkafleeg.
$

```

OpenSSH's config file can be relied on for configuration of SSH and SCP clients:-

```
$ cat ~/.ssh/config
Host attic attic.example.com
    Hostname attic.example.com
    Port 10022
    IdentitiesOnly yes
    IdentityFile ~/.ssh/id_ed25519
    User willy

$ cat another-example.php
require_once 'path/to/vendor/autoload.php';

use SSHClient\ClientConfiguration\ClientConfiguration;
use SSHClient\ClientBuilder\ClientBuilder;

$config = new ClientConfiguration('attic', 'willy');
$builder = new ClientBuilder($config);

$ssh_client = $builder->buildClient();
print($ssh_client->exec(array('hostname'))->getOutput());
print($ssh_client->exec(array('whoami'))->getOutput());
# end another-example.php

$ php another-example.php
attic.example.com
willy
$

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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 ~27 days

Recently: every ~40 days

Total

7

Last Release

3542d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db66b320db18b8036ea68211b7d8a39e7c6da97e6fd29f59a50380ebb69d0bb?d=identicon)[joostfaassen](/maintainers/joostfaassen)

![](https://www.gravatar.com/avatar/19f8d602132a01fd1e79793c91e73aed64ea31f65748096e4120904169027779?d=identicon)[boite](/maintainers/boite)

---

Top Contributors

[![boite](https://avatars.githubusercontent.com/u/989892?v=4)](https://github.com/boite "boite (11 commits)")[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k245.4M23.9k](/packages/friendsofphp-php-cs-fixer)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[illuminate/process

The Illuminate Process package.

44813.9k96](/packages/illuminate-process)

PHPackages © 2026

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