/ Published in: PHP
This SSH API is used to execute remote commands, send and receive files.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class SshApi extends BaseObject{ public $session = null; public $authenticated = false; public function __construct(){ } public function connect($host){ return $this->session; } public function pubkeyFile($sshUser, $sshPub, $sshPriv, $sshPass){ if ( ! $this->session ) return false; } else if ( $b ) $this->authenticated = true; return $b; } public function send($localfile, $remotefile, $perms=0660){ $this->debug(__METHOD__); if ( ! $this->session ) return false; $this->debug('Sending '. $localfile . ' to ' . $remotefile); return $b; } public function recv($remotefile , $localfile){ if ( ! $this->session ) return false; return $b; } if ( ! $this->session ) return false; return $stream; } }