<br><br><div class="gmail_quote">On Wed, Jul 21, 2010 at 10:01 AM, James <span dir="ltr"><<a href="mailto:jucziz6@gmail.com">jucziz6@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Anyone ever use rsync to propagate the sudoer file?<br>
<br></blockquote><div><br>I've found that often times the best way to copy a file while preserving its permissions is to wrap it up in a tarball, move the tarball, extract it, and wallah - permissions that never get borked. Perhaps not as graceful as having rsync do it all, but whenever I've mirrored file and filesystems with files owned by root and containing setuid binaries or very restrictive files like the sudoers file, tar has preserved permissions the most faithfully for me. <br>
<br>If you're having trouble coaxing rsync into doing the right thing, you could also wrap the rsync in a script, use rsync to move the bits, and have your script enforce permissions with chmods and chowns and chgrps after the rsync. <br>
<br>Maybe you're not running an enterprise environment, but the "super-slick professional way" to mirror your sudoers file would be to manage it in subversion or something and distribute it with cfengine. That might be overkill for you, but it could be a fun experiment. :) Some links you might peruse: <br>
<br><a href="http://en.wikipedia.org/wiki/Comparison_of_open_source_configuration_management_software">http://en.wikipedia.org/wiki/Comparison_of_open_source_configuration_management_software</a><br><a href="http://www.cfengine.org/pages/manual_guides">http://www.cfengine.org/pages/manual_guides</a><br>
<a href="http://watson-wilson.ca/blog/cfcookbook.html">http://watson-wilson.ca/blog/cfcookbook.html</a> (Search for sudoers on this page)<br><br>-Rob<br></div></div>