(PECL ssh2 >= 0.9.0)
ssh2_auth_none — 使用「none」驗證
嘗試使用「none」驗證,通常會(也應該)失敗。作為失敗的一部分,此函式將返回一個接受的驗證方法陣列。
如果伺服器接受 "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 "伺服器支援密碼驗證\n";
}
?>