Craig Box's journeys, stories and notes...


GPG agent doesn't prompt for my passphrase

Something that has always bothered me; I use the gpg-agent program to cache my passphrase in memory, but if I call it from dpkg-buildpackage or falcon, it just does this:

You need a passphrase to unlock the secret key for
user: "IT Partners <packages@itpartners.co.nz>"
1024-bit DSA key, ID xxxxxxx, created 2005-04-21

gpg: cancelled by user
gpg: skipped "xxxxxxxx": bad passphrase

Why does it punish me so? Turns out that pinentry, the program that asks for the passphrase, can't find a terminal, so can't run, and the key doesn't get cached.

To fix this, you can set the GPG_TTY variable, which I do in my .bashrc like so: export GPG_TTY=`tty`

Problem solved. And added to the WLUG wiki for posterity.

Tags: , , ,

Leave a Reply