Here is one way:
#!/bin/bash -p old_settings=$(stty -g) trap 'stty $old_settings' EXIT HUP echo -n "Enter Password: " stty raw -echo ichr=. value= oifs="$IFS" IFS= while [[ $ichr != "" ]]; do read -n1 ichr [[ -n $ichr ]] && echo -n '.' value="$value$ichr" done IFS="$oifs" stty -raw echo echo echo $value | passwd --stdin
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.
Brian Cluff
On 09/09/2013 06:49 AM, Shawn Badger wrote:
Thanks Brian, i was hoping it wouldn't be that deep of a change, I
think my users will just have to get used to it since I'm not thinking
it a big enough problem to change the app. It is always good to be able
to have the choice to though :)
On Fri, Sep 6, 2013 at 8:51 AM, Brian Cluff <brian@snaptek.com<mailto:brian@snaptek.com>> wrote:
I was just reading though the source for passwd and it looks like
there isn't a way to do it without rewriting parts of passwd to not
use the getpass function, or rewriting getpass itself if you want
everything to output the stars.
The getpass() function opens /dev/tty (the controlling
terminal of the process), outputs the string prompt, turns off
echoing, reads one line (the "password"), restores the terminal
state and closes /dev/tty again.
Brian Cluff
On 09/06/2013 08:13 AM, Shawn Badger wrote:
Thanks Larry!!
I have found several articles on how to do form within sudo, but
nothing
on how to get passwd or bash to do it so far.
On Thu, Sep 5, 2013 at 4:29 PM, Dazed_75 <lthielster@gmail.com
<mailto:lthielster@gmail.com><mailto:lthielster@gmail.com <mailto:lthielster@gmail.com>>> wrote:<mailto:lthielster@gmail.com
Oops! I misread your question. That was for the part you
already know.
On Thu, Sep 5, 2013 at 4:27 PM, Dazed_75
<lthielster@gmail.com <mailto:lthielster@gmail.com>
<mailto:lthielster@gmail.com>>> wrote:
http://www.maketecheasier.com/__quick-tips/show-password-__asterisks-in-terminal
<http://www.maketecheasier.com/quick-tips/show-password-asterisks-in-terminal>
worked for me :)
On Thu, Sep 5, 2013 at 12:55 PM, Shawn Badger
<shawn@badger.pro <mailto:shawn@badger.pro><mailto:shawn@badger.pro <mailto:shawn@badger.pro>>> wrote:------------------------------__---------------------
I have how to display password feed back while
using sudo,
but Google has failed me on how to display feedback
while
running passwd in a terminal session. Does anyone
know if
the pwfeedback environment setting works outside of
sudoers
file or an equivalent setting for the passwd command?
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.__org
<mailto:PLUG-discuss@lists.phxlinux.org>
<mailto:PLUG-discuss@lists.__phxlinux.orghttp://lists.phxlinux.org/__mailman/listinfo/plug-discuss
<mailto:PLUG-discuss@lists.phxlinux.org>>
To subscribe, unsubscribe, or to change your mail
settings:------------------------------__---------------------
<http://lists.phxlinux.org/mailman/listinfo/plug-discuss>
--
Dazed_75 a.k.a. Larry
Please protect my address like I protect yours. When
sending
messages to multiple recipients, use the BCC: (Blind carbon
copy). Remove addresses from a forwarded message body
before
clicking Send.
--
Dazed_75 a.k.a. Larry
Please protect my address like I protect yours. When sending
messages to multiple recipients, use the BCC: (Blind carbon
copy).
Remove addresses from a forwarded message body before
clicking Send.
PLUG-discuss mailing list -
PLUG-discuss@lists.phxlinux.__org
<mailto:PLUG-discuss@lists.phxlinux.org>
<mailto:PLUG-discuss@lists.__phxlinux.orghttp://lists.phxlinux.org/__mailman/listinfo/plug-discuss
<mailto:PLUG-discuss@lists.phxlinux.org>>
To subscribe, unsubscribe, or to change your mail settings:
<http://lists.phxlinux.org/mailman/listinfo/plug-discuss>
------------------------------__---------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.__orghttp://lists.phxlinux.org/__mailman/listinfo/plug-discuss
<mailto:PLUG-discuss@lists.phxlinux.org>
To subscribe, unsubscribe, or to change your mail settings:
<http://lists.phxlinux.org/mailman/listinfo/plug-discuss>
------------------------------__---------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.__orghttp://lists.phxlinux.org/__mailman/listinfo/plug-discuss
<mailto:PLUG-discuss@lists.phxlinux.org>
To subscribe, unsubscribe, or to change your mail settings:
<http://lists.phxlinux.org/mailman/listinfo/plug-discuss>
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss