Home > PHP > Function > SSH2 > ssh2_auth_pubkey_file()

ssh2_auth_pubkey_file()

ssh2_auth_pubkey_file - Authenticate using a public key

Syntax

bool ssh2_auth_pubkey_file (resource $session, string $username, string $pubkeyfile, string $privkeyfile, string $passphrase)

Arguments

  • session - An SSH connection link identifier, obtained from a call to ssh2_connect().
  • username
  • pubkeyfile
  • privkeyfile
  • passphrase - If privkeyfile is encrypted (which it should be), the passphrase must be provided.

Description

Authenticate using a public key read from a file.

Version

PHP PECL ssh2 >= 0.9.0

Return value

Returns TRUE on success or FALSE on failure.