<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(51,51,255)"><pre class=""><span class="">Here is one way:<br>#!/bin/bash -p</span>
<span class="">old_settings</span>=<span class="">$(</span><span class="">stty -g</span><span class="">)</span>
<span class="">trap</span> <span class="">'</span><span class="">stty $old_settings</span><span class="">'</span> EXIT HUP
<span class="">echo</span><span class=""> -n </span><span class="">"</span><span class="">Enter Password: </span><span class="">"</span>
stty raw <span class="">-echo</span>
<span class="">ichr</span>=.
<span class="">value</span>=
<span class="">oifs</span>=<span class="">"</span><span class="">$IFS</span><span class="">"</span>
<span class="">IFS</span>=
<span class="">while </span><span class="">[[</span> <span class="">$ichr</span> <span class="">!=</span> <span class="">""</span> <span class="">]]</span><span class="">;</span> <span class="">do</span>
<span class="">read</span> -n1 ichr
<span class="">[[</span> <span class="">-n</span> <span class="">$ichr</span> <span class="">]]</span> <span class="">&&</span> <span class="">echo</span><span class=""> -n </span><span class="">'</span><span class="">.</span><span class="">'</span>
<span class="">value</span>=<span class="">"</span><span class="">$value$ichr</span><span class="">"</span>
<span class="">done</span>
<span class="">IFS</span>=<span class="">"</span><span class="">$oifs</span><span class="">"</span>
stty <span class="">-raw</span> <span class="">echo</span>
<span class="">echo</span>
echo <span class=""></span><span class="">$value</span><span class=""> | </span><b>passwd --stdin</b><span class=""></span></pre></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>-- JD Austin<br>
Voice: 480.269.4335 (480 2MY Geek)<br><a href="mailto:jd@twingeckos.com" target="_blank">jd@twingeckos.com</a></div><br></div></div>
<br><br><div class="gmail_quote">On Mon, Sep 9, 2013 at 7:41 AM, Brian Cluff <span dir="ltr"><<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You could always wrap your passwd command with a shell script that just tells them that the password prompt won't echo anything and then immediately runs the real password program.<br>
<br>
Brian Cluff<div class="im"><br>
<br>
On 09/09/2013 06:49 AM, Shawn Badger wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Thanks Brian, i was hoping it wouldn't be that deep of a change, I<br>
think my users will just have to get used to it since I'm not thinking<br>
it a big enough problem to change the app. It is always good to be able<br>
to have the choice to though :)<br>
<br>
<br>
<br>
<br>
<br>
On Fri, Sep 6, 2013 at 8:51 AM, Brian Cluff <<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a><br></div><div class="im">
<mailto:<a href="mailto:brian@snaptek.com" target="_blank">brian@snaptek.com</a>>> wrote:<br>
<br>
I was just reading though the source for passwd and it looks like<br>
there isn't a way to do it without rewriting parts of passwd to not<br>
use the getpass function, or rewriting getpass itself if you want<br>
everything to output the stars.<br>
<br>
The getpass() function opens /dev/tty (the controlling<br>
terminal of the process), outputs the string prompt, turns off<br>
echoing, reads one line (the "password"), restores the terminal<br>
state and closes /dev/tty again.<br>
<br>
Brian Cluff<br>
<br>
<br>
On 09/06/2013 08:13 AM, Shawn Badger wrote:<br>
<br>
Thanks Larry!!<br>
I have found several articles on how to do form within sudo, but<br>
nothing<br>
on how to get passwd or bash to do it so far.<br>
<br>
<br>
On Thu, Sep 5, 2013 at 4:29 PM, Dazed_75 <<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a><br>
<mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a>><br></div><div class="im">
<mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a> <mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a>>><u></u>> wrote:<br>
<br>
Oops! I misread your question. That was for the part you<br>
already know.<br>
<br>
<br>
On Thu, Sep 5, 2013 at 4:27 PM, Dazed_75<br>
<<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a> <mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a>><br></div>
<mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a><br>
<mailto:<a href="mailto:lthielster@gmail.com" target="_blank">lthielster@gmail.com</a>>><u></u>> wrote:<br>
<br>
<a href="http://www.maketecheasier.com/__quick-tips/show-password-__asterisks-in-terminal" target="_blank">http://www.maketecheasier.com/<u></u>__quick-tips/show-password-__<u></u>asterisks-in-terminal</a><div class="im">
<br>
<<a href="http://www.maketecheasier.com/quick-tips/show-password-asterisks-in-terminal" target="_blank">http://www.maketecheasier.<u></u>com/quick-tips/show-password-<u></u>asterisks-in-terminal</a>><br>
<br>
worked for me :)<br>
<br>
<br>
On Thu, Sep 5, 2013 at 12:55 PM, Shawn Badger<br>
<<a href="mailto:shawn@badger.pro" target="_blank">shawn@badger.pro</a> <mailto:<a href="mailto:shawn@badger.pro" target="_blank">shawn@badger.pro</a>><br></div><div class="im">
<mailto:<a href="mailto:shawn@badger.pro" target="_blank">shawn@badger.pro</a> <mailto:<a href="mailto:shawn@badger.pro" target="_blank">shawn@badger.pro</a>>>> wrote:<br>
<br>
I have how to display password feed back while<br>
using sudo,<br>
but Google has failed me on how to display feedback<br>
while<br>
running passwd in a terminal session. Does anyone<br>
know if<br>
the pwfeedback environment setting works outside of<br>
sudoers<br>
file or an equivalent setting for the passwd command?<br>
<br>
<br>
<br></div>
------------------------------<u></u>__---------------------<br>
PLUG-discuss mailing list -<br>
PLUG-discuss@lists.phxlinux.__<u></u>org<br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>><br>
<mailto:<a href="mailto:PLUG-discuss@lists." target="_blank">PLUG-discuss@lists.</a>__<a href="http://phxlinux.org" target="_blank">p<u></u>hxlinux.org</a><div class="im"><br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>>><br>
<br>
To subscribe, unsubscribe, or to change your mail<br>
settings:<br></div>
<a href="http://lists.phxlinux.org/__mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/__<u></u>mailman/listinfo/plug-discuss</a><div class="im"><br>
<<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a>><br>
<br>
<br>
<br>
<br>
--<br>
Dazed_75 a.k.a. Larry<br>
<br>
Please protect my address like I protect yours. When<br>
sending<br>
messages to multiple recipients, use the BCC: (Blind carbon<br>
copy). Remove addresses from a forwarded message body<br>
before<br>
clicking Send.<br>
<br>
<br>
<br>
<br>
--<br>
Dazed_75 a.k.a. Larry<br>
<br>
Please protect my address like I protect yours. When sending<br>
messages to multiple recipients, use the BCC: (Blind carbon<br>
copy).<br>
Remove addresses from a forwarded message body before<br>
clicking Send.<br>
<br></div>
------------------------------<u></u>__---------------------<br>
PLUG-discuss mailing list -<br>
PLUG-discuss@lists.phxlinux.__<u></u>org<br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>><br>
<mailto:<a href="mailto:PLUG-discuss@lists." target="_blank">PLUG-discuss@lists.</a>__<a href="http://phxlinux.org" target="_blank">p<u></u>hxlinux.org</a><div class="im"><br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>>><br>
<br>
To subscribe, unsubscribe, or to change your mail settings:<br></div>
<a href="http://lists.phxlinux.org/__mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/__<u></u>mailman/listinfo/plug-discuss</a><br>
<<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a>><br>
<br>
<br>
<br>
<br>
------------------------------<u></u>__---------------------<br>
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.__<u></u>org<div class="im"><br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>><br>
To subscribe, unsubscribe, or to change your mail settings:<br></div>
<a href="http://lists.phxlinux.org/__mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/__<u></u>mailman/listinfo/plug-discuss</a><br>
<<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a>><br>
<br>
------------------------------<u></u>__---------------------<br>
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.__<u></u>org<div class="im"><br>
<mailto:<a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.<u></u>phxlinux.org</a>><br>
To subscribe, unsubscribe, or to change your mail settings:<br></div>
<a href="http://lists.phxlinux.org/__mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/__<u></u>mailman/listinfo/plug-discuss</a><div class="im"><br>
<<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a>><br>
<br>
<br>
<br>
<br>
------------------------------<u></u>---------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.<u></u>org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a><br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
------------------------------<u></u>---------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.<u></u>org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/<u></u>mailman/listinfo/plug-discuss</a><br>
</div></div></blockquote></div><br></div>