Home > php教程 > php手册 > body text

PHP远程执行SSH封装

WBOY
Release: 2016-06-06 20:13:16
Original
1610 people have browsed it

有一个特殊需求,需要远程在管理多台主机,执行一些命令操作,又不想在远程机器上多装程序或者做接口。考虑了几个方案,nginx+lua,nginx+python,都比较麻烦。想来想去,干脆直接php执行shell好了。查了一下,有libssh2+ssh2的方案,了解之后觉得还不错,只

有一个特殊需求,需要远程在管理多台主机,执行一些命令操作,又不想在远程机器上多装程序或者做接口。考虑了几个方案,nginx+lua,nginx+python,都比较麻烦。想来想去,干脆直接php执行shell好了。查了一下,有libssh2+ssh2的方案,了解之后觉得还不错,只需要在主控一端安装,并且是熟悉的PHP。于是装了个试试,封装了一下常用的几个ssh操作。

[...]

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template