duandianwen1723 2013-02-01 15:34
浏览 24

从php页面获取我的路由器VIA SSH CLI的信息

All,

I'm fairly new to php (simple forms and hello world stuff)

I'm trying to create a page that when loaded will go out grab some text information from a SSH session on my router parse it out and display it

The general idea would be

connect to (ip address, port) send line (loginuser + Password) send line (su to root + password) send line (command) receive text from command (string X)

parse x and display stats as html on page

I've seen a few tutorials on how to install libraries from ubuntu but my host is godaddy so i wont have access to install anything in that manner (i only have simple ftp access)

I'm looking for a simple simple simple ssh client and hopefully a small example on how to use it (send commands and retrieve text)

Thanks if you can help

  • 写回答

2条回答

  • drwkqwa82140 2013-02-01 15:41
    关注

    PHP is not the right tool in my opinion, you can achieve better results with expect and some bash stuff.

    expect is a good tool for command line activities. Try to have a look

    评论

报告相同问题?

悬赏问题

  • ¥15 用三极管设计一个单管共射放大电路
  • ¥20 fluent无法启动
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架