<div class="gmail_quote">Cant you just pipe the password and grab the outputs/readlines? For example the command i have to run as sudo = rsh dunebot cifs top<br>so I just send the command = echo mysuperhardpassword | sudo -S rsh dunebot cifs top<br>
and that seems to work in normal ssh.<br><br><br>
&gt;&gt;&gt; Justin Cook wrote:<br>
&gt;&gt;&gt;&gt; Ok, I&#39;m an idiot. Password prompt goes to stderr...<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Tue, Feb 26, 2008 at 1:55 PM, Justin Cook &lt;<a href="mailto:jhcook@gmail.com">jhcook@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; There are a couple ways I can see to do it readily offhand. One, I<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;haven&#39;t figured out how to receive the sudo password prompt yet.<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;Apparently, it writes the password prompt to a terminal device. So,<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;you should be able to set an alarm and send the password down the<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;channel in event there is no response from the command. This is<br>
&gt;&gt;&gt;&gt;&gt; dirty<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;IMO.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;Secondly, and perhaps more clean to use in conjunction with the<br>
&gt;&gt;&gt;&gt;&gt; first<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;option, is to use the -k or -K option to invalidate the sudo<br>
&gt;&gt;&gt;&gt;&gt; timestamp<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;and thus requiring to send the password on every invocation and not<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;worry about whether or not you&#39;ve been prompted. However, this isn&#39;t<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;very clean either in case no password is required.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;Not a good solution in either respect in my opinion. If this can be<br>
&gt;&gt;&gt;&gt;&gt; &nbsp;done easily with SSHClient someone shoot me in the foot!<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; &quot;Formulations of number theory: Complete, Consistent, Non-trivial.<br>
&gt;&gt;&gt; Choose two.&quot;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; &quot;Formulations of number theory: Complete, Consistent, Non-trivial.<br>
&gt;&gt; Choose two.&quot;<br>
&gt;<br>
<br>
--<br>
&quot;Formulations of number theory: Complete, Consistent, Non-trivial. Choose two.&quot;<br>
<br>
<br>
Animal Logic<br>
<a href="http://www.animallogic.com" target="_blank">http://www.animallogic.com</a><br>
<br>
Please think of the environment before printing this email.<br>
<br>
This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free.<br>

<br>
<br>
<br>
</div><br>