bashkarev / ssh
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/bashkarev/ssh
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2025-10-02 10:07:45 UTC
README
status: in progress
Installation
The preferred way to install this extension is through composer.
Either run
composer require bashkarev/ssh
Usage
$client = new \Bashkarev\Ssh\Client('127.0.0.1'); $client ->setPort(22) ->setUser('ssh_user') ->setIdentityFile('path/to/private_key') ->setForwardAgent(true); /** * @var \Bashkarev\Ssh\Command $command */ $command = $client->exec('php -v', 360, 60); foreach ($command->getIterator() as $type => $data) { if ($command::OUT === $type) { echo "\nRead from stdout: " . $data; } else { // $command::ERR === $type echo "\nRead from stderr: " . $data; } } $command->getExitCode();