title: "su <otheruser>" fails with "standard in must be atty"
body: <p>I researched this question and all answers suggest visudo to add:
  Defaults:user !requiretty</p>
  
  <p>It does not work!</p>
  
  <p>I have two Linux boxes (RedHat). I have a Java class which uses ProcessBuilder/Process to execute commands.  The class runs under a system account.
  On both boxes, I run </p>
  
  <pre><code>su other-user -c 'some-command'
  </code></pre>
  
  <p>and provide the password for other-user in an input stream to the Process object.</p>
  
  <p>On one box, the command succeeds and on the other I get the error above.
  The sudoers files on both machines did not have exclusions for requiretty ('Defaults requiretty' is set on both files).
  I tried adding the exclusion as suggested by the answers I found. I tried both the system user running the process and 'other-user'... </p>
  
  <p>Does not work.</p>
  
  <p>What else can be the issue? Do I need to restart the system after adding the requiretty exceptoin(s)?</p>