Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having done a fresh install I need to set this up again. We could do with an up to date guide. This might encourage more people to use encryption and signing.

I already have a keyring, but others need to know how to do that. That should probably be a separate question. I use KGPG to manage my keys.

In Kmail I know you need to set the default signing and encryption keys on your Identity.

When I try to sign an email it complains that signing failed without asking for my pass-phrase. What am I missing? How should I configure cryptography in Kmail?

share|improve this question
What is the exact error when it fails? – mac9416 Aug 13 '10 at 12:44
Signing failed: Bad passphrase – steevc Aug 13 '10 at 15:47
Do you have pinentry (pinentry-qt4) installed? If so, by any chance does the password dialog pop up for a moment and immediately close itself once it gains focus? – David Z Aug 14 '10 at 8:45
did anyone happen to solve this? I have exactly the very same issue... – user3170712 Apr 25 '14 at 16:48
up vote 2 down vote accepted

You need to put


in your ~/.gnupg/gpg.conf

I know because Seahorse used to put a blank file there and break things for people using GNOME & KDE together. I wrote the patch that made it properly copy the skeleton file, but that wasn't until 2009.

share|improve this answer
I've done that and gpg-agent is installed. How do I make sure it is running? – steevc Aug 13 '10 at 15:48
ps -ef | grep agent – maco Aug 13 '10 at 16:46
It's running. And I had pinentry-qt4 already. – steevc Aug 14 '10 at 18:54
Maybe I just needed another restart, but it's working now. Pinentry is popping up for my passphrase – steevc Aug 16 '10 at 19:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.