简体   繁体   English

使用phpseclib Interactive Shell显示多于17行

[英]Display more than 17 lines using phpseclib Interactive shell

I'm using phpseclib to access my SSH screen. 我正在使用phpseclib访问我的SSH屏幕。 It works very well with the below code, except I can't display more than 17 rows (40 would be nice). 它与下面的代码很好地配合,除了我不能显示超过17行(40行就可以了)。 I tried different things like changing definitions in File/ANSI.php file but without success. 我尝试了其他操作,例如更改File / ANSI.php文件中的定义,但没有成功。

Can it be done with phpseclib files or is it something I have to modify on my (linux/debian) server ? 可以使用phpseclib文件完成此操作,还是必须在我的(linux / debian)服务器上对其进行修改?

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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