pollita Mon Dec 27 22:25:39 2004 EDT
Modified files: /phpdoc/en/reference/ssh2/functions ssh2-auth-pubkey-file.xml Log: Add example for ssh2_auth_pubkey_file() http://cvs.php.net/diff.php/phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml diff -u phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml:1.1 phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml:1.2 --- phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml:1.1 Fri Dec 24 20:03:17 2004 +++ phpdoc/en/reference/ssh2/functions/ssh2-auth-pubkey-file.xml Mon Dec 27 22:25:39 2004 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. --> <refentry id="function.ssh2-auth-pubkey-file"> <refnamediv> @@ -15,13 +15,33 @@ <methodparam><type>resource</type><parameter>session</parameter></methodparam> <methodparam><type>string</type><parameter>username</parameter></methodparam> <methodparam><type>string</type><parameter>pubkeyfile</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>privkeyfile</parameter></methodparam> + <methodparam><type>string</type><parameter>privkeyfile</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam> </methodsynopsis> - <para> - Authenticate using a public key read from a file. - </para> + <simpara> + Authenticate using a public key read from a file. If <parameter>privkeyfile</parameter> + is encrypted (which it should be), the passphrase must be provided. + </simpara> + + <example> + <title>Authentication using a public key</title> + <programlisting role="php"> +<![CDATA[ +<?php +$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'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'); +} +?> +]]> + </programlisting> + </example> </refsect1> </refentry>