|
|
@ -72,11 +72,11 @@ class SshConnector extends CPHPBaseClass
|
|
|
|
|
|
|
|
|
|
|
|
if(empty($this->passphrase))
|
|
|
|
if(empty($this->passphrase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$result = ssh2_auth_pubkey_file($this->user, $this->pubkey, $this->key);
|
|
|
|
$result = ssh2_auth_pubkey_file($this->connection, $this->user, $this->pubkey, $this->key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$result = ssh2_auth_pubkey_file($this->user, $this->pubkey, $this->key, $this->passphrase);
|
|
|
|
$result = ssh2_auth_pubkey_file($this->connection, $this->user, $this->pubkey, $this->key, $this->passphrase);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($result === true)
|
|
|
|
if($result === true)
|
|
|
@ -100,7 +100,7 @@ class SshConnector extends CPHPBaseClass
|
|
|
|
private function DoCommand($command)
|
|
|
|
private function DoCommand($command)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$stream = ssh2_exec($this->connection, $command);
|
|
|
|
$stream = ssh2_exec($this->connection, $command);
|
|
|
|
echo($stream);
|
|
|
|
var_dump($stream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|