If Machine A is a Windows box, you can use Plink (part of PuTTY) with the -m parameter, and it will execute the local script on the remote server.
plink root@MachineB -m local_script.sh
If Machine A is a Unix-based system, you can use:
ssh root@MachineB 'bash -s' < local_script.sh
or:
ssh user@host <<'ENDSSH' #commands to run on remote host ENDSSH
or
ssh user@host ' command '
本文介绍如何从一台计算机(MachineA)远程执行另一台计算机(MachineB)上的脚本。如果MachineA是Windows系统,可以使用Plink(PuTTY的一部分),通过-m参数执行本地脚本。若MachineA为Unix系统,则可通过SSH命令结合bash来实现远程脚本执行。
3908

被折叠的 条评论
为什么被折叠?



