<div>Okay guys, I'm stuck. Not sure where to go from here.</div>
<div> </div>
<div>
<div id="post_message_302192966">I'm trying to create a script to remove users from sudoers on multiple servers. I'm able to do this with a one-line script using sed, but only if it's on one server. <br><b>Example: sed '/someuser/d' /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'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 = ("Alpha", "Echo", "India", "Joliet", "Kilo", "November",<br> "Papa", "Uniform", "Sierra", "Wiskey");<br>
<br>open(FILE, "@mysite/local/etc/sudoers");<br>@site = <FILE>;<br>close(FILE);</font></em></div>
<div> </div>
<div> </div>
<div>I know I need to throw in a for loop, maybe a few, I don't know. I'm stuck! </div></div>