array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.ssh2-shell.php', 1 => 'ssh2_shell', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 関数', ), 'prev' => array ( 0 => 'function.ssh2-sftp.php', 1 => 'ssh2_sftp', ), 'next' => array ( 0 => 'function.ssh2-tunnel.php', 1 => 'ssh2_tunnel', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/ssh2/functions/ssh2-shell.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_shell — 対話式のシェルを要求する
$session
,$termtype
= "vanilla",$env
= null
,$width
= 80,$height
= 25,$width_height_type
= SSH2_TERM_UNIT_CHARSリモートエンド上のシェルをオープンし、そのためのストリームを割り当てます。
session
ssh2_connect() のコールによって取得した SSH 接続リンク ID。
termtype
termtype
は対象システムの
/etc/termcap
に記載されたエントリの一つに相当します。
env
env
には、
対象の環境に設定する名前/値の組の連想配列を渡すことができます。
width
仮想端末の幅。
height
仮想端末の高さ。
width_height_type
width_height_type
は
SSH2_TERM_UNIT_CHARS
あるいは
SSH2_TERM_UNIT_PIXELS
のいずれかです。
成功した場合、ストリームリソースを返します。
失敗した場合に false
を返します.
例1 対話シェルのリクエスト
<?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);
?>