<div dir="ltr">thanks.... I think I am grasping it!</div><div class="gmail_extra"><br clear="all"><div>:-)~MIKE~(-:</div>
<br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 9:48 PM, James Dugger <span dir="ltr"><<a href="mailto:james.dugger@gmail.com" target="_blank">james.dugger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">Michael,<br><br>The following line: <br><br>     %sudo ALL=(ALL)  NOPASSWD:  ALL<br><br> literally means:<br>



<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">      ALL users in the sudo group can execute ALL commands as ALL users from ALL places without a password.<br>



</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



Without any lines after this.  The only thing that you would need to do is add users to the sudo group (/etc/group).  Thus the line:<br><br>     $  sudo useradd -G sudo <user><br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



The %sudo portion of the stanza tells Linux to look in the /etc/group file for a line starting with "sudo" and include any users listed on that line in the sudo group.  This way you don't have to add them individually as separate lines in the sudoers file. For example lets say you have 3 users (john, jane, sam) that you want to have sudo rights w/o a password. It could be done in one of two ways: <br>



<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">1st- in sudoers<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



     jane ALL=(ALL)  NOPASSWD:  ALL</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">     john ALL=(ALL)  NOPASSWD:  ALL<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



     sam ALL=(ALL)  NOPASSWD:  ALL<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">or <br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



2nd - in sudoers and /etc/group<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">     %sudo ALL=(ALL)  NOPASSWD:  ALL<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



in /etc/group<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">     sudo:x:##:john,jane,sam<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">



<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(11,83,148)">Both work but programmatically the 2nd option eliminates redundant code when writing scripts and allows the use of additional shell commands (and arguably more simple ones) to be used to maintain file changes (i.e. sudo useradd -a -G sudo <user>).  When scripting it is easier add the use of usermod and useradd to a script than to use commands like sed -i and then having to escape special characters like "%, (,  and )" when making changes or updates.<br>



<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Jul 14, 2014 at 7:48 PM, Michael Havens <span dir="ltr"><<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>I was wondering: these are the instructions I was given to make it so I don't need to input my password after I sudo.</div>



<div>---</div><div>sudo visudo</div><div><password></div><div><br></div>

<div>comment out the line:</div><div><br></div><div>  %sudo ALL=(ALL:ALL) ALL </div><div><br></div><div>and add a new line below it like this:</div><div><br></div><div>  %sudo ALL=(ALL)  NOPASSWD:  ALL</div><div><br></div>





<div>  sudo useradd -G sudo <user></div><div>---</div><div>I was thinking that with the script being like that I probably don't need the last line because the way it is I am telling it no one needs a password with sudo. It would probably be more secure to have:</div>





<div><br></div><div><div>  %sudo ALL=(ALL)  NOPASSWD:  <desired users>  </div></div><div><br></div><div>is that correct? If I had multiple users who I wanted to not use a password would I separate the users with a space or comma? If I only wanted one user to be able to sudo  it would be:</div>





<div><br></div><div>  %sudo <user>=(ALL)  NOPASSWD:  <user></div><div><br></div><div>what is the point of th ALL surrounded by parentheses?</div><div>:-)~MIKE~(-:</div>
</div>
<br></div></div><div class="">---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all">

<br>-- <br><div dir="ltr"><font color="#0b5394">James</font><div>

<br><span style="color:rgb(255,255,255)"><span style="background-color:rgb(11,83,148)"><b><a href="http://www.linkedin.com/pub/james-h-dugger/15/64b/74a/" target="_blank"><span style="background-color:rgb(255,255,255)"><span></span><span style="color:rgb(11,83,148)">Linkedin<span></span></span></span></a></b></span></span><br>



</div></div>
</font></span></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>