Running full commands through remote ssh [duplicate]

可紊 提交于 2019-11-29 23:05:46
mopsled

Try writing your bash script locally and calling:

ssh user@example.com 'bash -s' < local_script.sh

(Found in the discussion here)

Write a script, copy it to the remote machine and from ssh run just that script.

Another workaround is to use python. There is a module called pexpect that can solve your problem, and even more complicated scenario.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!