PHPackages                             phizzl/php-ssh2-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. [File &amp; Storage](/categories/file-storage)
4. /
5. phizzl/php-ssh2-client

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

phizzl/php-ssh2-client
======================

Library for transfering files via SSH2

v1.0.0(8y ago)17GPL-3.0PHP

Since Sep 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/phizzl/php-ssh2-client)[ Packagist](https://packagist.org/packages/phizzl/php-ssh2-client)[ RSS](/packages/phizzl-php-ssh2-client/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

SSH2 client
===========

[](#ssh2-client)

A SSH2 client written in PHP

Authentication
--------------

[](#authentication)

You may choose between the authentication modes pubkey, password and none.

### Authentication with password

[](#authentication-with-password)

```
$auth = new PasswordAuthentication("vagrant", "vagrant");
```

### Authentication with public and private keypair

[](#authentication-with-public-and-private-keypair)

```
$auth = new PublicKeyAuthentication("vagrant", "/path/to/id_rsa.pub", "/path/to/id_rsa", "keypassword");
```

### No authentication

[](#no-authentication)

```
$auth = new NoneAuthentication("vagrant");
```

Creating the SSH2 session
-------------------------

[](#creating-the-ssh2-session)

After you configured your authentication you may create the SSH2 session and pass the authentication to it.

```
$auth = new PasswordAuthentication("vagrant", "vagrant");
$session = new SshSession("localhost", 22, $auth);
```

Creating the SSH2 client
------------------------

[](#creating-the-ssh2-client)

Now that you have a session you can create the SSH2 client and pass the session to it.

```
$auth = new PasswordAuthentication("vagrant", "vagrant");
$session = new SshSession("localhost", 22, $auth);
$sshClient = new SshClient($session);
```

Using the SSH2 client
---------------------

[](#using-the-ssh2-client)

After you created the SSH2 client you are ready to use it.

```
$sshClient->sendFile('/local/path/to/file.txt, '~/uploads/file.txt');
```

```
$sshClient->receiveFile('~/downloads/remote.file', '/local/path/local.file');
```

```
$sshClient->removeFile('~/downloads/remote.file');
```

```
$sshClient->createDirectory('~/uploads/newdir');
```

```
$sshClient->removeDirectory('~/uploads/newdir', true)
```

```
$sshClient->sendDirectory('/local/dir', '~/uploads/newdir');
```

```
$sshClient->removeDirectory('~/uploads/newdir', true);
```

```
$sshClient->receiveDirectory('~/downloads/backup', '/local/dir/backup');
```

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

3096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c97e3bef66ef0074ad9f0fe89d74a6bec22b2940cf11f4cb41707e15c316589?d=identicon)[phizzl](/maintainers/phizzl)

---

Tags

sshfiletransfer

### Embed Badge

![Health badge](/badges/phizzl-php-ssh2-client/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k626.7M1.9k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k257.1M684](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.2M116](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

73628.2M84](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226221.1M24](/packages/league-flysystem-local)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8532.5M166](/packages/league-flysystem-memory)

PHPackages © 2026

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