1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-29 02:53:11 +02:00
Files
archived-doc-ja/reference/ssh2/functions/ssh2-auth-pubkey-file.xml
T
TAKAGI Masahiro 9d7e0f2894 Sync with en
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@336930 c90b9560-bf6c-de11-be94-00142212c4b1
2015-06-12 03:50:49 +00:00

142 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 8269f33ca8b41d78961b45886bae92d3700bbf2f Maintainer: shimooka Status: ready -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ssh2-auth-pubkey-file">
<refnamediv>
<refname>ssh2_auth_pubkey_file</refname>
<refpurpose>公開鍵を使用した認証を行う</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ssh2_auth_pubkey_file</methodname>
<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><type>string</type><parameter>privkeyfile</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>passphrase</parameter></methodparam>
</methodsynopsis>
<para>
ファイルから読み込んだ公開鍵を使用した認証を行います。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>session</parameter></term>
<listitem>
<para>
<function>ssh2_connect</function> のコールによって取得した
SSH 接続リンク ID。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>username</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pubkeyfile</parameter></term>
<listitem>
<para>
公開鍵ファイル。OpenSSH 形式で表す必要があり、たとえば次のようになります。
</para>
<para>
ssh-rsa AAAAB3NzaC1yc2EAAA....NX6sqSnHA8= rsa-key-20121110
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>privkeyfile</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>passphrase</parameter></term>
<listitem>
<para>
もし、<parameter>privkeyfile</parameter> が暗号化されている
(そうあるべきです) 場合、パスフレーズも引数に渡す必要があります。
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>公開鍵を用いた認証</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>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
この関数が使っている libssh ライブラリは、部分的な認証のサポートがうまくできません。
公開鍵とパスワードの両方が必要な場合に、まるで関数が失敗したかのように見えてしまいます。
この場合の関数呼び出しの失敗は、単に認証がまだ完了していないということを表しているにすぎません。
この呼び出し失敗は無視し、続けて <function>ssh2_auth_password</function>
を呼ばなければ認証は完了しません。
</para>
</note>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->