array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.ssh2-auth-password.php', 1 => 'ssh2_auth_password', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'Fonctions Shell2', ), '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' => 'fr', '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 — Identification via SSH en utilisant un mot de passe en clair
Identification via SSH en utilisant un mot de passe en clair. Depuis la version 0.12, cette fonction supporte également la méthode keyboard_interactive.
session
Un identifiant de connexion SSH, obtenu depuis la fonction ssh2_connect().
username
Nom d'utilisateur distant.
password
Mot de passe pour l'utilisateur username
.
Exemple #1 Identification avec un mot de passe
<?php
$connection = ssh2_connect('shell.example.com', 22);
if (ssh2_auth_password($connection, 'username', 'secret')) {
echo "Identification réussi !\n";
} else {
die('Echec de l\'identification...');
}
?>