execute part of shell script on remote machine

后端 未结 4 740
逝去的感伤
逝去的感伤 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:33

    ssh -t user@remotehost 'uptime' user@remotehost's password: 23:35:33 up 2:05, 3 users, load average: 0.79, 0.52, 0.60 Connection to remote closed.

    When you specify -t, it opens the terminal in remote machine and execute the command.

提交回复
热议问题