duanpu8830 2012-08-28 14:00
浏览 69

如何在Windows环境下通过PHP连接远程Linux盒

I'm on a Windows XP machine, with Wamp installed. Currently, I am using putty to connect my remote Linux boxes.

I want to execute Linux commands through php shell_exec() method (cp, ls, ...).

Does anybody know how to connect my Linux box first and then run those commands in a Windows environment?

Any advice's would be highly appreciated...

  • 写回答

4条回答 默认 最新

  • dongxun1142 2012-08-28 14:31
    关注

    You can't run Linux commands in Windows. You can run them over SSH, using putty. It seems you have that running.

    You can forward the connection over ssh. Look in the putty screen, go to Connection > SSH > Tunnels.

    Then you add a tunnel:

    source port: 1234 
    destination port: localhost:80
    type is Local
    

    So you open Internet Explorer, type in the addres bar: http://localhost:1234 the port 1234 is then forwarded to the port 80 on the remote linux pc.

    You can also forward it to the WAMP by setting

    destination port: *ip of the wamp server*:80
    

    Then you can acces the Windows pc from outside the network, as long as putty is running.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料