(PECL ssh2 >= 0.9.0)
ssh2_shell — Solicita un shell interactivo
$session
,$termtype
= "vanilla",$env
= null
,$width
= 80,$height
= 25,$width_height_type
= SSH2_TERM_UNIT_CHARSAbre un shell en el servidor remoto y le asigna un flujo.
session
Un identificador de conexión SSH, obtenido desde la función ssh2_connect().
termtype
termtype
debe corresponder a una
de las entradas del fichero /etc/termcap
del sistema objetivo.
env
env
debe ser pasado como un array asociativo
de pares nombre/valor a definir en el entorno objetivo.
width
Ancho del terminal virtual.
height
Altura del terminal virtual.
width_height_type
width_height_type
debe ser o bien
SSH2_TERM_UNIT_CHARS
, o bien
SSH2_TERM_UNIT_PIXELS
.
Ejemplo #1 Ejecución de un comando
<?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);
?>