如何从网页在 Linux 机器上执行命令?
我通常使用 PuTTY 在 Linux 机器上执行命令。但我希望制作一个网页,通过简单的按钮点击,我可以在 Linux 机器上执行特定的命令。 有哪些可用的选项以及哪一种是易于实施的?
I usually use PuTTY to execute commands on a Linux machine. But I wish to make a webpage from where I can execute specific commands on a Linux machine by simple button clicks.
What are the various options available and what is the one that is easy to implement?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这取决于您运行的服务器类型。但几乎所有服务器都有某种 CGI 支持或同等支持。请记住,这通常会导致安全问题。
This depends on the kind of server you are running. But almost all servers have some kind of CGI support or an equivalent. Keep in mind that this can often cause a security issue.
我认为您不能而且应该尝试在页面中嵌入脚本代码。
最好的建议可能是超链接脚本文件并让用户从您的服务器获取它。
只需将该文件放在服务器上,然后对其进行超链接即可。
I don't think you can and should try to embed script code in your page.
The best suggestion may be to hyperlink a script file and let the user get it from your server.
Just put that file on the server and then hyperlink it.
securewebcmd 可以做到这一点,因为您
securewebcmd can do this for you