title: Need to use sudo su - in Unix shell script
body: <p>I am at beginner level and I need to use <code>sudo su -</code> and <code>pwd</code> in one command line in script for two different users.  (I'm using <code>pwd</code> as an example; the specific command is not important.) 
  And I am using command <code>sudo su - user -c pwd</code>. This command works when switching to one user, but not when switching to another.</p>
  
  <p>For example:-</p>
  
  <pre><code>$ sudo su - ora -c pwd
  /oracle/
  $ sudo su - adm -c pwd
  Sorry, user myuser is not allowed to execute '/usr/bin/su - adm -c pwd' as root on server.
  $
  </code></pre>
  
  <p>How can I make it work for 'adm' user too?</p>