phpseclib SSH2写入未执行长命令 [英] phpseclib SSH2 write not executing long command
本文介绍了phpseclib SSH2写入未执行长命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试对设备(防火墙)执行SSH命令.长度短时执行命令.当长度大约为1000个字符时,则不执行命令.
I am trying to execute an SSH command to a device (firewall). Command is executed when the length is short. When the length is about 1000 characters, command is not being executed.
当我通过腻子执行命令时,它也可以正常工作.
When I execute the command via putty, that is working as well.
在阅读了一些解决方案后,我尝试将超时设置为5秒.仍然没有帮助.
After reading few solutions, I tried to set timeout to 5 seconds. Still, no help.
在设备日志中,我可以看到SSH登录和注销.但是没有活动.
In the device logs, I can see SSH login and logout. But no activity.
我正在使用phpseclib ssh 2.0版
I am using phpseclib ssh version 2.0
$ssh = new SSH2(ip_address);
$ssh->login($user, $password);
$ssh->write($command);
$ssh->setTimeout(5);
$ssh->read()
推荐答案
问题最终出现在服务器和设备之间的路径中.
Issue ended up being in the path between server and the device.
这篇关于phpseclib SSH2写入未执行长命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文