On Thu, Dec 05, 2013 at 10:09:07AM +0000, Zé Loff wrote: > Not sure how advisable this is, but I'm using a gpg encrypted file, > which I keep somewhere hidden (just because). Just put them in file > foo and do 'gpg -e foo' (assuming you've already setup gpg). When you > need to look something up just do 'gpg -d foo' and the file gets > decrypted to stdout. > > I use it mostly for mutt (see the top of > http://nixtricks.wordpress.com/2010/05/20/mutt-multiple-email-accounts-using-hooks/) > but you can keep anything in there, obviously. >
I have this snippet in .kshrc, it needs the xclip tool from packages. function getpass { gpg --decrypt $HOME/pw.gpg | grep "^$1" | awk '{print $2}' \ | tr -d '\n' | xclip -i } The plaintext of pw.gpg has lines like this: key password Run 'getpass somekey', enter pgp passphrase, and you can paste the password with the middle button (if you want it to go into the e.g. GTK+ paste buffer instead, try the -selection option of xclip). To generate passwords, I use 'pwgen 32' (see pwgen package). > its not like I'm keeping the password to root accounts or anything of > the like in there... Me neither.