I have a question regarding a task that I want to accomplish. I have a website whose back-end is written in laravel 5 and using mysql as a database. On the website dashboard there is tab named status. What I wanted to do is that when I click on the status tab it will fetch a server IP from the table that is already present in the database. Make ssh connection on that server IP, execute a bash command on the remote terminal and show the output of the command on the dashboard. Is it possible to do in laravel? I have seen 2 packages that are available in laravel for ssh connection. One is ssh by laravelcollective and other is envoy by laravel but i am unable to figure out how they will accomplish this task. Any help in this regard would be highly appreciated. Thanks.
1条回答 默认 最新
- doubi4491 2018-08-04 09:51关注
One way to accomplish this is by using the
ssh2_connect
which allows you to create the connection and then you can execute commands and retrieve the results in via callbacksHere you have the full documentation which comes with nice examples on everything I said before.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥20 MATLAB仿真三相桥式全控整流电路
- ¥15 EDA技术关于时序电路设计
- ¥15 百度文心一言流式返回sse失败
- ¥15 由于远程方已关闭传输流,身份验证失败
- ¥15 rt-detr,PCB,目标检测
- ¥15 有偿求指导实证代码。cfps清洗合并后,无论是构建平衡面板还是非平衡面板,都是只剩几百个样本量。求指导一下哪里出问题了,不要潦草回复
- ¥15 mutlinichenet
- ¥50 Qt5.14.2怎样使用qlistwidget存储指针类数据并更新?
- ¥15 STM32多路复用器ADC采样
- ¥20 Linux(ubuntu)操作相关问题