我正在使用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
?>
答案 0 :(得分:0)
最后,我可以通过修改Net / SSH2.php来添加行:
var $windowRows = 24;