PHPackages                             prsw/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. prsw/ssh-client

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

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

Async SSH client for PHP using amphp v3 fibers. Supports password and public key auth, command execution with streaming output, and interactive shell.

01PHP

Since May 9Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PRSW SSH Client
===============

[](#prsw-ssh-client)

Async SSH client for PHP, built on [amphp](https://amphp.org/) v3 fibers.

No libssh2 dependency. Pure PHP — uses ext-openssl, ext-sodium, and ext-gmp for crypto.

Install
-------

[](#install)

```
composer require prsw/ssh-client
```

Quick Start
-----------

[](#quick-start)

### Execute a command

[](#execute-a-command)

```
\Amp\async(function (): void {
    $client = \PRSW\Ssh\Client\SshClient::connect(
        'host:22',
        new \PRSW\Ssh\Client\Authentication\PasswordAuthentication('user', 'password'),
    );

    $exec = $client->exec('ls -la');
    \Amp\ByteStream\pipe($exec->getStdout(), \Amp\ByteStream\getStdout());
    $exitCode = $exec->wait();
})->await();
```

### Interactive shell

[](#interactive-shell)

```
\Amp\async(function (): void {
    $client = \PRSW\Ssh\Client\SshClient::connect(
        'host:22',
        new \PRSW\Ssh\Client\Authentication\PasswordAuthentication('user', 'password'),
    );

    $shell = $client->shell();
    \Amp\ByteStream\pipe(\Amp\ByteStream\getStdin(),  $shell->getStdin());
    \Amp\ByteStream\pipe($shell->getStdout(), \Amp\ByteStream\getStdout());
    \Amp\ByteStream\pipe($shell->getStderr(), \Amp\ByteStream\getStderr());
    $shell->wait();
})->await();
```

### Public key auth

[](#public-key-auth)

```
$auth = new \PRSW\Ssh\Client\Authentication\PublicKeyAuthentication(
    'user',
    privateKey: '/home/user/.ssh/id_ed25519',
);

\Amp\async(function () use ($auth): void {
    $client = \PRSW\Ssh\Client\SshClient::connect('host:22', $auth);
    $exec = $client->exec('whoami');
    \Amp\ByteStream\pipe($exec->getStdout(), \Amp\ByteStream\getStdout());
    $exec->wait();
})->await();
```

Requirements
------------

[](#requirements)

- PHP 8.4+
- ext-openssl, ext-sodium, ext-gmp, ext-hash

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance56

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/023a0bd17758df473ae6dad9f07575a8d0a8c36b06e83396b5962aecba38c722?d=identicon)[PrasWicaksono](/maintainers/PrasWicaksono)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[aoxiang/province-city-area

China Province City Area From JD.COM

1497.5k](/packages/aoxiang-province-city-area)[bitrix-expert/bbc-module

Module with classes for the basis components

1952.2k1](/packages/bitrix-expert-bbc-module)[hschottm/tags

tags is a Contao extension that provides an architecture to tag any Contao element.

1015.3k](/packages/hschottm-tags)

PHPackages © 2026

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