diff --git a/reference/ssh2/functions/ssh2-auth-pubkey-file.xml b/reference/ssh2/functions/ssh2-auth-pubkey-file.xml index 6a8522b812..8284a4272d 100644 --- a/reference/ssh2/functions/ssh2-auth-pubkey-file.xml +++ b/reference/ssh2/functions/ssh2-auth-pubkey-file.xml @@ -1,5 +1,5 @@ - + @@ -15,13 +15,33 @@ resourcesession stringusername stringpubkeyfile - stringprivkeyfile + stringprivkeyfile stringpassphrase - - Authenticate using a public key read from a file. - + + Authenticate using a public key read from a file. If privkeyfile + is encrypted (which it should be), the passphrase must be provided. + + + + Authentication using a public key + +'ssh-rsa')); + +if (ssh2_auth_pubkey_file($connection, 'username', + '/home/username/.ssh/id_rsa.pub', + '/home/username/.ssh/id_rsa', 'secret')) { + echo "Public Key Authentication Successful\n"; +} else { + die('Public Key Authentication Failed'); +} +?> +]]> + +