How to run a script file remotely using SSH

后端 未结 6 1684
无人共我
无人共我 2020-12-07 12:17

I want to run a script remotely. But the system doesn\'t recognize the path. It complains that \"no such file or directory\". Am I using it right?

ssh kev@se         


        
6条回答
  •  遥遥无期
    2020-12-07 13:05

    If you want to execute a local script remotely without saving that script remotely you can do it like this:

    cat local_script.sh | ssh user@remotehost 'bash -'
    

    It works like a charm for me.

    I do that even from Windows to Linux given that you have MSYS installed on your Windows computer.

提交回复
热议问题