2016-12-26 291 views

回答

0
/tmp/sh.sh is shell script on remote server. 

#!/bin/bash 
ssh "[email protected]" 'sh -c "((nohup /tmp/sh.sh))"'  

#use following for suppressing the output from remote server script. 
ssh "[email protected]" 'sh -c "((nohup /tmp/sh.sh &>/dev/null) &)"' 
+0

我有一个疑问这个问题,难道我们不需要任何密码的,因为我连接到其他服务器。在你的代码中表示没有提及密码? – sandeepKumar

+1

@sandeepKumar用私钥设置ssh。 – Barmar