<div>Okay guys, I&#39;m stuck. Not sure where to go from here.</div>
<div>&nbsp;</div>
<div>
<div id="post_message_302192966">I&#39;m trying to create a script to remove users from sudoers on multiple servers. I&#39;m able to do this with a one-line script using sed, but only if it&#39;s on one server. <br><b>Example: sed &#39;/someuser/d&#39; /host/local/etc/sudoers</b><br>
Also, I think the problem with this one-line script is that I would have to redirect my output to another sudoers file (sudoers.new) and then mv that file to sudoers for it to work more effectively.<br><br>Since the hosts are all tied to the ldap server I can just run the script from there by changing the host path without having to log into multiple servers.<br>
<br>This is what I have so far in Perl, but I&#39;m not sure how to continue or how to add the sed line in here. <br><br><em><font color="#000066">#!/usr/bin/perl -w<br><br># this script removes a user from sudoers file<br>
<br>@mysites = (&quot;Alpha&quot;, &quot;Echo&quot;, &quot;India&quot;, &quot;Joliet&quot;, &quot;Kilo&quot;, &quot;November&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Papa&quot;, &quot;Uniform&quot;, &quot;Sierra&quot;, &quot;Wiskey&quot;);<br>
<br>open(FILE, &quot;@mysite/local/etc/sudoers&quot;);<br>@site = &lt;FILE&gt;;<br>close(FILE);</font></em></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>I know I need to throw in a for loop, maybe a few, I don&#39;t know.&nbsp;I&#39;m stuck! </div></div>