<p>I'm writing a C Shell program that will be doing <code>su</code> or <code>sudo</code> or <code>ssh</code>. They all want their passwords in console input (the TTY) rather than stdin or the command line.</p>

<p>Does anybody know a solution?</p>

<p>Setting up password-less <code>sudo</code> is not an option.</p>

<p><a href="/questions/tagged/expect" class="post-tag" title="show questions tagged &#39;expect&#39;" rel="tag">expect</a> could be an option, but it's not present on my stripped-down system.</p>

Take a look at
```
expect
```
linux utility.
It allows you to send output to stdio based on simple pattern matching on stdin.