Skip to content

pDonatas/php-ssh-connection

Repository files navigation

PHP SSH Connection

Build Status Coverage Status

Installation

composer require divineomega/php-ssh-connection

Usage

$connection = (new SSHConnection())
            ->to('test.rebex.net')
            ->onPort(22)
            ->as('demo')
            ->withPassword('password')
         // ->withKeyPair($publicKeyPath, $privateKeyPath)
            ->connect();

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

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%