title: Running processes with "nologin" shell on Redhat
body: <p>I'd read on a few Tomcat guides to run Tomcat as a user with <code>nologin</code> as the shell in order to prevent this user from being able to use the shell if there was a security breach in Tomcat.</p>
  
  <p>I'd tried executing a script as this user with the setuid <code>(-rws---r-x)</code> and also by using <code>su -s /bin/sh my_nologin_user myscript.sh</code> but I am finding that it is able to execute commands like <code>pwd</code> 
  <code>ps -ef</code> 
  <code>grep</code> .</p>
  
  <p>Clearly I am misunderstanding this but I can't see what the point of using nologin as the shell is if the Tomcat startup script could be edited to perform any shell command (if hacked).</p>