I am writing a script which would be potentially dangerous if run in the wrong way. As a safety feature, I want the script to require the user to re-enter their password first, much as
So how do I do this? In other words how do I
a) input the password without echoing it,
b) verify the password, and
c) (for bonus points) do this without leaving the plaintext password lying around in memory for some clever chap to scrape out of /proc or something like that?
This is in
bash but any other standard Linux shell variant would be ok if that's easier.