(PECL ssh2 >= 0.9.0)
ssh2_shell — Demande un shell interactif
$session
[, string $term_type = "vanilla"
[, array $env
[, int $width = 80
[, int $height = 25
[, int $width_height_type = SSH2_TERM_UNIT_CHARS
]]]]] ) : resourceOuvre un shell sur le serveur distant et lui alloue un flux.
sessionUn identifiant de connexion SSH, obtenu depuis la fonction ssh2_connect().
term_type
term_type doit correspondre à une
des entrées du fichier /etc/termcap du système cible.
env
env doit être passé en tant qu'un tableau associatif
de paire nom/valeur à définir dans l'environnement cible.
widthLargeur du terminal virtuel.
heightHauteur du terminal virtuel.
width_height_type
width_height_type doit être soit
SSH2_TERM_UNIT_CHARS, soit
SSH2_TERM_UNIT_PIXELS.
Exemple #1 Exécution d'une commande
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$stream = ssh2_shell($connection, 'vt102', null, 80, 24, SSH2_TERM_UNIT_CHARS);
?>