PHPackages                             pdonatas/php-ssh-connection - 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. pdonatas/php-ssh-connection

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

pdonatas/php-ssh-connection
===========================

Provides an elegant syntax to connect to SSH servers and execute commands.

v2.2.1(2y ago)05LGPL-3.0-onlyPHPPHP ^8.0

Since Jul 31Pushed 2y agoCompare

[ Source](https://github.com/pDonatas/php-ssh-connection)[ Packagist](https://packagist.org/packages/pdonatas/php-ssh-connection)[ RSS](/packages/pdonatas-php-ssh-connection/feed)WikiDiscussions master Synced yesterday

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

PHP SSH Connection
==================

[](#php-ssh-connection)

As old repo () is abandoned I'll continue the support on this fork.

The PHP SSH Connection package provides an elegant syntax to connect to SSH servers and execute commands. It supports both password and public-private keypair authentication, and can easily capture command output and errors.

Installation
------------

[](#installation)

You can install the PHP SSH Connection package by running the following Composer command.

```
composer require pdonatas/php-ssh-connection
```

Usage
-----

[](#usage)

See the following basic usage instructions.

```
$connection = (new SSHConnection())
            ->to('test.rebex.net')
            ->onPort(22)
            ->as('demo')
            ->withPassword('password')
         // ->withPrivateKey($privateKeyPath)
         // ->withPrivateKeyString($privateKeyString)
         // ->timeout(0)
            ->connect();

$command = $connection->run('echo "Hello world!"');

$command->getOutput();  // 'Hello World'
$command->getError();   // ''

$connection->upload($localPath, $remotePath);
$connection->download($remotePath, $localPath);
```

For security, you can fingerprint the remote server and verify the fingerprint remains the same upon each subsequent connection.

```
$fingerprint = $connection->fingerprint();

if ($newConnection->fingerprint() != $fingerprint) {
    throw new Exception('Fingerprint does not match!');
}
```

If you wish, you can specify the type of fingerprint you wish to retrieve.

```
$md5Fingerprint  = $connection->fingerprint(SSHConnection::FINGERPRINT_MD5); // default
$sha1Fingerprint = $connection->fingerprint(SSHConnection::FINGERPRINT_SHA1);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 91.8% 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 ~172 days

Recently: every ~386 days

Total

10

Last Release

975d ago

Major Versions

v1.3.1 → v2.0.02019-08-08

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.2.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/132a8a7728c5df458c6581b66aeafcdb0f3c1e59c19c4ff9ddb673811fd3d00a?d=identicon)[pDonatas](/maintainers/pDonatas)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (56 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![sboesch](https://avatars.githubusercontent.com/u/16945695?v=4)](https://github.com/sboesch "sboesch (2 commits)")[![sonaldo](https://avatars.githubusercontent.com/u/3761019?v=4)](https://github.com/sonaldo "sonaldo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pdonatas-php-ssh-connection/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M885](/packages/laravel-socialite)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[civicrm/civicrm-core

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

751291.4k43](/packages/civicrm-civicrm-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[shopware/administration

Administration frontend for the Shopware Core

414.3M116](/packages/shopware-administration)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)

PHPackages © 2026

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