(PECL ssh2 >= 0.12)
ssh2_auth_agent — 使用 ssh 代理程式透過 SSH 進行驗證
使用 ssh 代理程式透過 SSH 進行驗證
注意: 只有當 ssh2 擴充套件使用 libssh >= 1.2.3 編譯時,ssh2_auth_agent() 函式才可用。
範例 #1 使用 ssh 代理程式進行驗證
<?php
$connection = ssh2_connect('shell.example.com', 22);
if (ssh2_auth_agent($connection, 'username')) {
echo "Authentication Successful!\n";
} else {
die('Authentication Failed...');
}
?>