Very new to Bash scripting well infact any scripting. So i hope that
you maybe able to help me out here.
I have a script that asks for a password to be entered so it can be
used later on in the script. This works great execpt tyat you can see
the password in plain text when you have enterd it on screen. What i
would really like it to do is to echo ****** as i type the password.
That way nobody should be able to scroll up the screen buffer to get
the password.
Is it possible? if so how
Cheers
Hi Ray,
You can always use stty to switch off echo, see:
<<<<<
#!/bin/sh
read -p "Username: " uname
stty -echo
read -p "Password: " passw; echo
stty echo
>>>>> (Source [1])
Please note that this still doesn't provide the same security level as
login (as an example of a secure input does) this is because other
users on your system could be running "ps -ef" where the input from
the second read could be visible.
HTH
[1] http://www.peterbe.com/plog/passwords-with-bash
--
Cheers,
Maxim Vexler
"Free as in Freedom" - Do u GNU ?