コード例 #1
0
ファイル: Password.php プロジェクト: oncesk/ssh2
 /**
  * @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);
 }
コード例 #2
0
ファイル: PublicKey.php プロジェクト: oncesk/ssh2
 /**
  * @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);
 }