title: Run a command as remote user ID in a web server
body: <p>I have a web application running on Tomcat7 and apache Httpd server. I have a use case to run  a command as remote or client user on the web server whose user account is different from remote user accounts. Currently I am handing this requirement by running web server as root user and allowing root user to sudo as remote user for executing the commands on server side. </p>
  
  <p>Please let me know if you have any better and secure ways to handle this.</p>
  
  <p>Thanks.</p>