PHPackages                             lguichard/process-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. lguichard/process-ssh

ActiveLibrary

lguichard/process-ssh
=====================

Package to use Laravel Process over SSH connections

1.0.4(1y ago)17MITPHPPHP ^8.1CI passing

Since Dec 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lguichard/process-ssh)[ Packagist](https://packagist.org/packages/lguichard/process-ssh)[ Fund](https://www.paypal.com/paypalme/lguichard01)[ GitHub Sponsors](https://github.com/lguichard)[ RSS](/packages/lguichard-process-ssh/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (8)Versions (5)Used By (0)

 [![Laravel Process over SSH](https://raw.githubusercontent.com/lguichard/process-ssh/master/assets/visual.webp)](https://raw.githubusercontent.com/lguichard/process-ssh/master/assets/visual.webp)

 [![GitHub Workflow Status (master)](https://github.com/lguichard/process-ssh/actions/workflows/tests.yml/badge.svg)](https://github.com/lguichard/process-ssh/actions) [![Latest Version](https://camo.githubusercontent.com/84b8690077361d4c5db7120ca64f4a274030fe676a6ce1a7ae70aae51f836114/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c67756963686172642f70726f636573732d737368)](https://packagist.org/packages/lguichard/process-ssh)

---

Laravel Process over SSH
========================

[](#laravel-process-over-ssh)

`Laravel Process over SSH` is a Laravel package that extends the `Illuminate\Process` functionality to allow command execution via SSH.

Features
--------

[](#features)

- Execute shell commands on remote servers using SSH.
- Full compatibility with Laravel's `Process` features.
- Easily configurable options like custom ports, passwords, private keys, and more.

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

[](#installation)

Install the package via Composer:

```
composer require lguichard/process-ssh
```

Usage
-----

[](#usage)

To execute a command over SSH, use the `Process` facade:

### Basic Usage

[](#basic-usage)

```
use Illuminate\Support\Facades\Process;

$result = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'password' => 'your_password',
    ])
    ->run('ls -al');

if ($result->successful()) {
    echo $result->output();
} else {
    echo $result->errorOutput();
}
```

### Using Private Key Authentication

[](#using-private-key-authentication)

```
$result = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'private_key' => '/path/to/private_key',
    ])
    ->run('ls -al');
```

### Disabling Strict Host Key Checking

[](#disabling-strict-host-key-checking)

```
$result = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'private_key' => '/path/to/private_key',
    ])
    ->disableStrictHostKeyChecking()
    ->run('ls -al');
```

### Adding Extra SSH Options

[](#adding-extra-ssh-options)

```
$result = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'private_key' => '/path/to/private_key',
    ])
    ->addExtraOption('-o LogLevel=ERROR')
    ->addExtraOption('-o ConnectTimeout=10')
    ->run('ls -al');
```

### Use the favorites method provided by Laravel's Process class.

[](#use-the-favorites-method-provided-by-laravels-process-class)

For more information, refer to the official documentation :

```
$process = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'password' => 'your_password',
    ])
    ->start('bash import.sh');

$result = $process->wait();
```

```
[$result1, $result2] = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'password' => 'your_password',
    ])
    ->concurrently(function (Pool $pool) {
        $pool->command('ls -al');
        $pool->command('whoami');
    });
```

```
$result = Process::ssh([
        'host' => '192.168.1.10',
        'user' => 'username',
        'password' => 'your_password',
    ])
    ->pool(function (Pool $pool) {
        $pool->command('ls -al');
        $pool->command('whoami');
    });
```

### SSH multiplexing

[](#ssh-multiplexing)

If you want to execute multiple commands over the same SSH connection, SSH multiplexing allows you to reuse an existing TCP connection, improving efficiency and reducing overhead.

```
$process = Process::ssh([
    'host' => '192.168.85.5',
    'user' => 'ubuntu',
    'port' => 22,
])->useMultiplexing();

$commands = [
    'ls -al', 'whoami',
    'pwd', 'uname -a',
    'df -h', 'top -bn1',
    'cat /etc/os-release', 'netstat -tuln',
    'uptime', 'tail -n 20 /var/log/syslog',
];

foreach ($commands as $command) {
    $process->run($command)->output();
}
```

Testing
-------

[](#testing)

To run the package's tests:

```
composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue on GitHub.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](LICENSE.md).

For more details, visit the [GitHub repository](https://github.com/lguichard/process-ssh).

Acknowledgments
---------------

[](#acknowledgments)

Special thanks to Spatie's SSH package for inspiring the creation of this package.

**Skeleton PHP** was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

4

Last Release

499d ago

PHP version history (2 changes)1.0.0PHP ^8.0

1.0.4PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/277f743b306ca5a20aed7be4ff53ae1d5715c8f33f30590a6fb1bd917352155a?d=identicon)[lguichard](/maintainers/lguichard)

---

Top Contributors

[![lguichard](https://avatars.githubusercontent.com/u/6489718?v=4)](https://github.com/lguichard "lguichard (33 commits)")

---

Tags

phplaravelsshprocess

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[monicahq/laravel-cloudflare

Add Cloudflare ip addresses to trusted proxies for Laravel.

3372.7M4](/packages/monicahq-laravel-cloudflare)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2031.2M2](/packages/glushkovds-phpclickhouse-laravel)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)

PHPackages © 2026

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