title: sudo as another user with password from stdin
body: <p>I am attempting to use <code>sudo</code> check to see if the password for the user is set to a standard password. </p>
  
  <p>I have read that you can use the <code>-S</code> option to receive input from <code>stdin</code> </p>
  
  <blockquote>
    <p>-S          The -S (stdin) option causes sudo to read the password from
                    the standard input instead of the terminal device.</p>
  </blockquote>
  
  <p>but when i run <code>echo 'password' | sudo -S -u user command</code></p>
  
  <p>it returns:</p>
  
  <pre><code>Password:
  Sorry, try again.
  Password:
  sudo: 1 incorrect password attempt
  </code></pre>
  
  <p>Could somebody tell me what is off with this script?</p>
  
  <p><strong>Note:</strong> I have tried other methods to check the password but I am having a hard time finding a solution because I do not have: root access, a c compiler, or the availability to install programs like expect</p>