/** * @param Client $client * @throws \RuntimeException * * @return mixed */ public function authenticate(Client $client) { if (!@ssh2_auth_password($client->getConnection(), $this->getUser(), $this->getPassword())) { throw new \RuntimeException('Authentication Failed'); } parent::authenticate($client); }
/** * @param Client $client * * @throws \RuntimeException * * @return mixed */ public function authenticate(Client $client) { if (!@ssh2_auth_pubkey_file($client->getConnection(), $this->getUser(), $this->pubKeyFile, $this->privateKeyFile, $this->passphrase)) { throw new \RuntimeException('Authentication Failed'); } parent::authenticate($client); }