簡體   English   中英

使用phpseclib Interactive Shell顯示多於17行

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

我正在使用phpseclib訪問我的SSH屏幕。 它與下面的代碼很好地配合,除了我不能顯示超過17行(40行就可以了)。 我嘗試了其他操作,例如更改File / ANSI.php文件中的定義,但沒有成功。

可以使用phpseclib文件完成此操作,還是必須在我的(linux / debian)服務器上對其進行修改?

我的檔案:

<?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