execute part of shell script on remote machine

后端 未结 4 748
逝去的感伤
逝去的感伤 2021-01-26 03:49

I am logging into remote machine through shell script (by placing ssh command in script). After ssh command ,The remaining lines of the script are getting executed on the curre

4条回答
  •  滥情空心
    2021-01-26 04:13

    Use ssh command with -t options. For example:

    ssh -t myremotehost 'uptime'
    name@myremotehost's password: 
    10:14:14 up 91 days, 21:20,  5 users,  load average: 0.20, 0.35, 0.36
    

提交回复
热议问题