From: Truhn Chad M CONT DLVA (TruhnCM@NSWC.NAVY.MIL)
Date: Wed Oct 20 2004 - 08:38:53 EDT
Thanks to everyone who responded, there were too many to name.
The general consensus between everyone was to use:
echo "password"
stty -echo #turns echo off
read password
stty echo #turns echo back on
or could use
echo "password"
read -s password # -s allows silent entry
Thanks again. You all saved me a lot of time!!!!
Chad Truhn
-----Original Message-----
From: Truhn Chad M CONT DLVA
Sent: Wednesday, October 20, 2004 7:51 AM
To: 'sunmanagers@sunmanagers.org'
Subject: Password in shell script
All:
I am trying to write a bash script that prompts a user for a password if
they want to run a specific function. I was able to encrypt the password so
that users cannot just 'more' a file and see the password, but when the
script is ran and it prompts for a password, it shows what they type on the
terminal. How do I change this so that their input is not displayed on the
screen for this line? I figure it is probably a single command, but I don't
even know where to begin to look.
Any help would be appreciated.
TIA
Thanks,
Chad M Truhn
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:29:35 EDT