示例#1
0
 public function sshExec($id)
 {
     $node = Node::getById($id);
     $connection = ssh2_connect(Config::get('ssh.host'), Config::get('ssh.port'));
     if (!$connection) {
         die('Connection failed');
     }
     ssh2_auth_password($connection, Config::get('ssh.username'), Config::get('ssh.password'));
     $stream = ssh2_exec($connection, '/usr/local/bin/php -i');
     return Redirect::back();
 }