Solved

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

Posted on 2006-07-24
3
210 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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