Execute Bash script stored in a file over SSH

前端 未结 5 1285
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 05:08

Say I have the following Bash script stored in the file foo.sh:

#!/bin/bash
echo foo

Without having to scp the fi

5条回答
  •  忘掉有多难
    2020-12-29 05:49

    You can use runoverssh:

    sudo apt install runoverssh
    
    runoverssh -s localscript.sh user host
    

    -s runs a local script remotely

提交回复
热议问题