title: Safely granted user sudo access
body: <p>From my past knowledge, normally if you wanted to give a user sudo access for certain commands, you could edit the /etc/sudoers file and add the line</p>
  
  <pre><code>username ALL=(ALL) listofcommands
  </code></pre>
  
  <p>From my understanding, this gives the user sudo access to those commands and not anything else. However, in my computer security class, one of the questions was regarding whether it was safe to grant users sudo access in this way, to explain why it is or isn't and if there's another way to grant the user access. Specifically</p>
  
  <pre><code>larry ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf 
  </code></pre>
  
  <p>So vim and website configuration. I've always assumed it was safe, but the question implies that it isn't and after doing some research, most everyone seems to do it this way. All of the insecurities seem to stem from the misuse of sudo itself. In this case, the only change is modifying /etc/sudoers. The user doesn't know the password and doesn't have sudo access to anything else (like for example, invoking a shell).</p>
  
  <p>The only thing I could think of was that maybe giving him sudo access to vim is a bad idea, since as far as I know, vim has the power to commands on the command line? </p>
  
  <p>But the main problem is, if I want to give a specific user sudo access to only certain commands, aside from adding them to sudoers, I don't know of any other way (aside from forcing him to ask an admin every time for sudo access). And I couldn't find anything online, since I think almost everyone does it this way.</p>