Solved

Concealing keyboard input? Or how to display *****'s instead of text

Posted on 2006-07-24
3
212 Views
Last Modified: 2010-04-22
Hi,
I'm writing a bash script to run under Cygwin to change users passwords on a Windows domain controler. My script uses the Windows "net user" command and I feed it the password as a variable.

In my script I'm using "read" to capture keyboard input into a variable but ofcourse the password is displayed on the screen. Is there a way I can conceal the password input with *****'s?
0
Comment
Question by:veedar
3 Comments
 
LVL 11

Accepted Solution

by:
grsteed earned 250 total points
ID: 17171709
This isn't exactly what your looking for but it does blank out the password entry.

# Turn off echo
stty -echo
echo -n "Enter Password: "
read password
stty echo

The last line turns the echo back on.

Cheers,
Gary
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 250 total points
ID: 17173306
How about using expect.

expect -re "Password '.*': "

http://expect.nist.gov/

regards
Manish Regmi
0
 
LVL 15

Author Comment

by:veedar
ID: 17176847
Thanks, blanking it out will work for me.

And a relevant expect doc here....
http://expect.nist.gov/doc/bgpasswd.pdf
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now