Helper tool to generate ssh command line
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');
composer require k92/ssh-exec
./vendor/bin/phpunit tests