Home > PHP > Function > SSH2 > ssh2_auth_hostbased_file()

ssh2_auth_hostbased_file()

ssh2_auth_hostbased_file - Authenticate using a public hostkey

Syntax

bool ssh2_auth_hostbased_file (resource $session, string $username, string $hostname, string $pubkeyfile, string $privkeyfile, string $passphrase, string $local_username)

Arguments

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

Description

Authenticate using a public hostkey read from a file.

Version

PHP PECL ssh2 >= 0.9.0

Return value

Returns TRUE on success or FALSE on failure.