array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.ssh2-auth-hostbased-file.php', 1 => 'ssh2_auth_hostbased_file', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 İşlevleri', ), 'prev' => array ( 0 => 'function.ssh2-auth-agent.php', 1 => 'ssh2_auth_agent', ), 'next' => array ( 0 => 'function.ssh2-auth-none.php', 1 => 'ssh2_auth_none', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/ssh2/functions/ssh2-auth-hostbased-file.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_auth_hostbased_file — Bir genel konak anahtarı kullanarak kimlik doğrulaması yapar
$oturum
,$kullanıcı
,$konakadı
,$genel_anh_dosyası
,$gizli_anh_dosyası
,$anh_parolası
= ?,$yerel_kullanıcı
= ?Genel konak anahtarını bir dosyadan okuyarak kimlik doğrulaması yapar.
oturum
ssh2_connect() ile sağlanan bir SSH bağlantı tanıtıcısı.
kullanıcı
konakadı
genel_anh_dosyası
gizli_anh_dosyası
anh_parolası
gizli_anh_dosyası
için bir parola kullanılmışsa
bu parola bu bağımsız değişkende belirtilmelidir. (SSH oturum anahtarları
genelde parolasız oluşturulur).
yerel_kullanıcı
Belirtilmezse yerine kullanıcı
kullanılır.
Örnek 1 - Genel konak anahtarlı kimlik doğrulama
<?php
baglanti = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_hostbased_file(baglanti, 'uzakbirey', 'myhost.example.com',
'/usr/local/etc/hostkey_rsa.pub',
'/usr/local/etc/hostkey_rsa', 'parola',
'yerelbirey')) {
echo "Kimlik Doğrulaması Başarılı!\n";
} else {
die('Kimlik Doğrulaması Başarısız...');
}
?>
Bilginize:
ssh2_auth_hostbased_file() işlevi libssh2 >= 0.7 ve PHP/SSH2 >= 0.7 gerektirir.