简体   繁体   English

如何从客户端在服务器上执行脚本?

[英]How to execute a script on server from client side?

I have a shell script placed at the root of a linux machine which acts as a server.I want to execute that script from client side 我在作为服务器的linux机器的根目录下放置了一个shell脚本,我想从客户端执行该脚本

could popen be used to achieve this or any other alternative approaches available ? popen可以用于实现此目的或任何其他替代方法吗?

您可以从客户端计算机使用“ ssh(服务器)(脚本/命令与路径一起运行)”。

这是一个如何做的例子:

ssh root@127.0.0.1 "( cd /var && chmod +x my_script.sh && ./my_script)"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在 ssh 连接期间从服务器端执行客户端命令? - Is it possible to execute client-side commands from the server-side during an ssh connection? 如何将执行命令的结果从服务器发送到客户端? - How to send result of execute command from server to client? 如何从Android客户端应用程序在Ubuntu Server上执行一组Python脚本并将结果返回到客户端应用程序 - How to execute a set of Python scripts at Ubuntu Server from Android Client app and return the result to client app 从客户端发送任何消息之前,无法从服务器端向客户端打印消息 - Unable to print message from server side to client side before sending any message from client 如何使用参数在远程服务器中执行本地脚本 - how to execute an local script in remote server with parameters 如何从 TCL 脚本执行 shell 脚本 - How to execute a shell script from a TCL script 如何在服务器上的线程和客户端上的线程之间同步? - How to synchronize between a thread on server and a thread on client side? 如何读取服务器端客户端发送的TLS证书? - How to read TLS certificate sent by a client on the server side? 如何在Linux中从C执行shell脚本? - How to execute a shell script from C in Linux? gdb如何从脚本执行目标程序 - gdb how to execute target program from script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM