php-ssh - php api для работы с ssh
Пример
https://github.com/Herzult/php-ssh
<?php
// simple configuration to connect "my-host"
$configuration = new Ssh\SshConfigFileConfiguration('/Users/username/.ssh/config', 'my-host');
$authentication = $configuration->getAuthentication('optional_passphrase', 'optional_username');
echo $exec->run('ls -lah');
https://github.com/Herzult/php-ssh