What is the cleanest way to ssh and run multiple commands in Bash?

前端 未结 12 2132
礼貌的吻别
礼貌的吻别 2020-11-22 09:14

I already have an ssh agent set up, and I can run commands on an external server in Bash script doing stuff like:

ssh blah_server "ls; pwd;"
         


        
12条回答
  •  逝去的感伤
    2020-11-22 09:26

    Not sure if the cleanest for long commands but certainly the easiest:

    ssh user@host "cmd1; cmd2; cmd3"
    

提交回复
热议问题