简体   繁体   中英

Display more than 17 lines using phpseclib Interactive shell

I'm using phpseclib to access my SSH screen. It works very well with the below code, except I can't display more than 17 rows (40 would be nice). I tried different things like changing definitions in File/ANSI.php file but without success.

Can it be done with phpseclib files or is it something I have to modify on my (linux/debian) server ?

My file :

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
include('Net/SSH2.php');
include('File/ANSI.php');

$ssh = new Net_SSH2('111.222.33.44');
if (!$ssh->login('user', 'passwd')) {
    exit('Login Failed');
}

$ansi = new File_ANSI();

$ssh->write("screen -r 27015\n");
$ssh->setTimeout(1);
$ansi->appendString($ssh->read());
echo $ansi->getScreen(); // outputs HTML
?>

最后,我能够通过修改Net / SSH2.php添加行:

var $windowRows = 24;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM