Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 718 Bytes

README.md

File metadata and controls

42 lines (33 loc) · 718 Bytes

SSH EXEC

Helper tool to generate ssh command line

Usage

use K92\SshExec\SSHEngine;

$se = (new SSHEngine)
    ->from([
        'ssh_privatekey_path' => '/root/.ssh/id_ed25519', 
    ])
    ->to([
        'ssh_address' => 'localhost',
        'ssh_debug' => true,
        'ssh_port' => 22,
        'ssh_socket_path' => null, // manual disable multiplexing
        'ssh_username' => 'root',
    ])
    ->exec([
        'ls -1 /opt/',
        'touch /opt/newfile'
    ])
    ->exec('ls -1 /opt/')
    ->exec('touch /opt/newfile');

Installation

composer require k92/ssh-exec

Testing

./vendor/bin/phpunit tests

License

MIT