duanjuhuo8772 2014-12-02 13:14
浏览 25

phplibsec等待时间已过期

I'm afraid this question looks trivial, but I'm working on it one entire day and can't understand what happen.

Im using the SSH library phpseclib to connect to a ssh host, and after that, doing a telnet connection

    <?php
    set_include_path(get_include_path() . "\\" . 'phpseclib');
    include('Net/SSH2.php');


    $ssh = new Net_SSH2('10.10.10.10');

    if (!$ssh->login('user', 'password'))
        {
        exit('Login Failed');
        }

    echo $ssh->read('$');
    echo "<hr />";

    echo $ssh->write("telnet 10.10.20.20
");
    echo "<hr />";

    echo $ssh->read('User');
    echo "<hr />";

    echo $ssh->write('admin
');
    echo"<hr />";

    echo $ssh->read('Password');
    $ssh->write('admin
');
    ?>

Well, debugging it stops after detect User. I think I send the user, but I wait forever for the string Password.

The exit I have in HTML code is the following

    Last login: Tue Dec 2 14:06:11 2014 from 10.10.10.2 $1 
    telnet 10.10.20.20 Telnet escape character is 'off'. Trying 10.10.20.20...         
    Connected to 10.10.20.20. Escape character is 'off'. ****Hello User1
    Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\php\pear\phpseclib\Net\SSH2.php on line 2699

Well, note that 1 appears twice, after the line of last login and the Hello User, that was not intentioned.

Well, any ideas?

On the other hand, I tried to use "exec" command, but with not success too.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
    • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序