I recently knocked one up; create a decent GPG key and use this script
- modify as necessary

It's not beautiful but it works for me.
#!/bin/sh

DATE=`date +%Y%m%d-%H%M%S`

PWD=$HOME/.ssh
PWP=$PWD/passwords
PWF=$PWP.gpg
PWO=$PWD/old/passwords.gpg.$DATE
ME="The name in the GPG key"

if [ "$1" = "view" ] ; then
        gpg -q -d $PWF | more
        echo ""
        echo -n "=== hit return to clear screen ==="
        read X
        clear
elif [ "$1" = "edit" ] ; then
        if [ -f $PWP ] ; then
                echo "Sorry, someone is editing the file right now"
        else
                touch $PWP
                chmod go= $PWP
                if [ -s $PWF ] ; then
                        gpg -q -d $PWF  >> $PWP
                        echo ""         >> $PWP
                        echo "$DATE   " >> $PWP
                        who am i        >> $PWP
                else
                        echo "Creating a new password file from scratch"
                        date > $PWP
                        echo "" >> $PWP
                fi
                vi $PWP

                mv $PWF $PWO
                gpg -q -e -r "$ME" $PWP
                chmod go= $PWF
                if [ ! -s $PWF ] ; then
                        echo "Error, encrypting to $PWF failed, result empty, 
please clean up plain text password file $PWP"
                else
                        # should really overwrite the file with urandom a few 
times
                        rm $PWP
                fi
        fi
else
        echo "Usage:"
        echo "passkeeper view|edit"
fi

stty sane
_______________________________________________
Angstrom-distro-users mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-users

Reply via email to