Shell 在本地执行另外一台远程机器命令
java;gutter:true;
sshpass -p "xxx" ssh root@192.168.238.12 << remotessh</p>
<p>cd /tmp/test/
rm -f test.txt
cat test.log | grep 'test' >> test2.txt
echo "finished!"</p>
<h1>执行完毕</h1>
<p>exit #退出远程机器
remotessh</p>
<pre><code>
其中xxx是密码[en]<u>Where xxx is the password</u>
</code></pre>
<p>sshpass -p "XXX"
Original: https://www.cnblogs.com/linlf03/p/16088680.html
Author: work hard work smart
Title: Shell在本地执行另外一台远程机器命令
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/5937/
转载文章受原作者版权保护。转载请注明原作者出处!