title: Execute Script as another user whilst not being root
body: <p><strong>Situation:</strong></p>
  
  <p>I'd like to execute a shellscript directly from a web-gui. The shellscript belongs to the user "tux".
  Since my webserver is running as apache, I can't execute tux's shellscript.
  OS: CENTOS</p>
  
  <p><strong>What I've tried:</strong></p>
  
  <pre><code>su -c "/opt/tomcat/bin/shutdown.sh" -s /bin/sh tux
  </code></pre>
  
  <p>I tried different ways, the mentioned one is how it worked when i was logged in as root user.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Is there a way to do the same while not being root? Something like a command where I can pass the user AND its password to execute the script.</p>
  
  <p>I can't just change the ownership of the script because it's depending on tux's profile (other files, directories).</p>
  
  <p>Thanks very very much in advance for your help!</p>