PHPackages                             bravo3/ssh - 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. [CLI &amp; Console](/categories/cli)
4. /
5. bravo3/ssh

ActiveLibrary[CLI &amp; Console](/categories/cli)

bravo3/ssh
==========

Interactive SSH2 suite for PHP 5.4

1.5.1(11y ago)191.0k11MITPHPPHP &gt;=5.4.0

Since Mar 23Pushed 11y ago7 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (14)Used By (1)

Interactive SSH2 for PHP
========================

[](#interactive-ssh2-for-php)

This module is a PHP wrapper for the libssh2 extension with support for interactive sessions. With interactive session support you can mimic a user terminal allowing you access to things such as sudo which might not typically be available to remote sessions. Unlike most libssh2 libraries, you do not need a public key file to authenticate using keys pairs.

Installation
============

[](#installation)

This project requires PHP-SSH2, which can be installed with `pecl`:

```
yum install libssh2-devel
# apt-get install libssh2-1-dev
yes '' | pecl install -f ssh2
echo "extension=ssh2.so" > /etc/php.d/ssh2.ini
# echo "extension=ssh2.so" > /etc/php5/mods-available/ssh2.ini
# ln -s /etc/php5/mods-available/ssh2.ini /etc/php5/apache2/conf.d/20-ssh2.ini
# ln -s /etc/php5/mods-available/ssh2.ini /etc/php5/cli/conf.d/20-ssh2.ini

```

Usage
=====

[](#usage)

- [Connections](docs/Connections.md)
- [Command Execution](docs/ExecutionStream.md)
- [Interactive Shell](docs/Shell.md)
- [Transfers](docs/Transfers.md)
- [Keypair Authentication](docs/KeypairAuthentication.md)

History
=======

[](#history)

1.4.2
-----

[](#142)

- Added timeout &amp; line-ending normalisation to smart commands

1.4.1
-----

[](#141)

- Added the ability to detect remote shell type
- Smart commands now work on C-shell variants
- Added pause timeouts to all other shell read functions
- Added the ability to normalise line-endings in shell output

1.4.0
-----

[](#140)

- Deprecated version 1.3.x
- Fixed logic of the ssh2\_tunnel() function

1.3.0
-----

[](#130)

- Added support to tunnel connections

1.2.0
-----

[](#120)

- Added ability to connect using just a private PEM key

1.1.0
-----

[](#110)

- Added SCP support

Known Bugs/Limitations
======================

[](#known-bugslimitations)

Bugs
----

[](#bugs)

This wrapper is subject to the same bugs that exist in the ssh2 extension, notable of those are the encrypted private key files running in Ubuntu/Debian:

-
- See [Encrypted Private Keys](docs/EncryptedPrivateKeys.md) for workaround

Limitations
-----------

[](#limitations)

#### Features implemented:

[](#features-implemented)

- Password and key-pair authentication
- Optional fingerprint checking
- Command execution
- Interactive shell (mimic user)
- SCP transfers
- Public key generation (connect using just a private key)
- Tunnels (remote connections)

#### Notable features not implemented:

[](#notable-features-not-implemented)

- Agent and host authentication
- SFTP transfers

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~14 days

Total

12

Last Release

4279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a82084f38dfacd80655e26cd45b5bb9ab43eaa09b3a97c5c4a2350fe41b0c20?d=identicon)[jordonsc](/maintainers/jordonsc)

---

Top Contributors

[![jordonsc](https://avatars.githubusercontent.com/u/347611?v=4)](https://github.com/jordonsc "jordonsc (34 commits)")

---

Tags

sshshellssh2

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[mikehaertl/php-shellcommand

An object oriented interface to shell commands

32437.5M61](/packages/mikehaertl-php-shellcommand)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.7M45](/packages/kevinlebrun-colorsphp)[mrrio/shellwrap

Use any command-line tool as a PHP function.

738198.8k2](/packages/mrrio-shellwrap)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24032.0k2](/packages/alecrabbit-php-console-spinner)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)

PHPackages © 2026

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