예제 #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);
 }