(PECL ssh2 >= 0.9.0)
ssh2_shell — Solicita um shell interativo
$session
,$termtype
= "vanilla",$env
= null
,$width
= 80,$height
= 25,$width_height_type
= SSH2_TERM_UNIT_CHARSAbre um shell na extremidade remota e aloca um fluxo para ele.
session
Um identificador de conexão SSH, obtido de uma chamada a ssh2_connect().
termtype
termtype
deve corresponder a uma das
entradas no arquivo /etc/termcap
do sistema de destino.
env
env
pode ser passado como um array associativo de
pares nome/valor para definir no ambiente de destino.
width
Largura do terminal virtual.
height
Altura do terminal virtual.
width_height_type
width_height_type
deve ser uma das constantes
SSH2_TERM_UNIT_CHARS
ou
SSH2_TERM_UNIT_PIXELS
.
Exemplo #1 Solicitando um shell interativo
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'usuario', 'senha');
$stream = ssh2_shell($connection, 'vt102', null, 80, 24, SSH2_TERM_UNIT_CHARS);
?>