secure the .password file
If you are going to use a plain-text file to store the user's password, please make sure no one else can read it
*Before* creating the .password file, run this:
touch ~joe/.password
chown joe ~joe/.password
chmod 600 ~joe/.password
For even more security, have the user securely delete the file once he has read it:
cat ~/.passwd
(memorize it, change it, or put it in a secure place)
shred -u ~/.passwd