带重定向的远程sudo
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了带重定向的远程sudo相关的知识,希望对你有一定的参考价值。
Ever wanted to execute remote commands with sudo while redirecting output to a file that doesn't belong to the user you login with? Combine single quotes with double quotes!
for server in one two three; do ssh $server sudo bash -c "'cat >> /some/file << EOF Some Content EOF'" done
以上是关于带重定向的远程sudo的主要内容,如果未能解决你的问题,请参考以下文章