Skip to content

Instantly share code, notes, and snippets.

@fhferreira
Created November 15, 2014 03:25
Show Gist options
  • Save fhferreira/5f8f8ff4d73332354a9a to your computer and use it in GitHub Desktop.
Save fhferreira/5f8f8ff4d73332354a9a to your computer and use it in GitHub Desktop.
PHP Sec Lib --- SSH Php
<?php
//https://github.com/phpseclib/phpseclib
include('./Net/SSH2.php');
$host = '127.0.0.1';
$user = 'root';
$port = '22';
$password = 'pass';
$command = "ls -la /srv/users/serverpilot/apps/hadouken";
$ssh = new Net_SSH2($host);
if (!$ssh->login($user, $password)) {
exit('Login Failed');
}
echo $ssh->exec($command);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment