CakeFest 2024: The Official CakePHP Conference

ssh2_auth_none

(PECL ssh2 >= 0.9.0)

ssh2_auth_none"none" として認証する

説明

ssh2_auth_none(resource $session, string $username): mixed

通常失敗する(そしてそうあるべき)"none" 認証を試みます。 失敗の一環として、サーバーは可能な認証メソッドの一覧を返します。

パラメータ

session

ssh2_connect() のコールによって取得した SSH 接続リンク ID。

username

リモートのユーザー名。

戻り値

もしサーバーが username に対する認証メソッドとして "none" を受け入れる場合、この関数は単純に true を返します。

例1 認証メソッドの一覧の取得

<?php
$connection
= ssh2_connect('shell.example.com', 22);

$auth_methods = ssh2_auth_none($connection, 'user');

if (
in_array('password', $auth_methods)) {
echo
"Server supports password based authentication\n";
}
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top