array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.ssh2-auth-password.php', 1 => 'ssh2_auth_password', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 関数', ), 'prev' => array ( 0 => 'function.ssh2-auth-none.php', 1 => 'ssh2_auth_none', ), 'next' => array ( 0 => 'function.ssh2-auth-pubkey-file.php', 1 => 'ssh2_auth_pubkey_file', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/ssh2/functions/ssh2-auth-password.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_auth_password — SSH 上でプレーンなパスワードを使用した認証を行う
SSH 上でプレーンなパスワードを使用した認証を行います。 バージョン 0.12 以降、この関数は keyboard_interactive 方式にも対応するようになりました。
session
ssh2_connect() のコールによって取得した SSH 接続リンク ID。
username
リモートのユーザー名。
password
username
のパスワード。
例1 パスワードを用いた認証
<?php
$connection = ssh2_connect('shell.example.com', 22);
if (ssh2_auth_password($connection, 'username', 'secret')) {
echo "Authentication Successful!\n";
} else {
die('Authentication Failed...');
}
?>