4

I'm using Thunderbird with enigmail and gpg. From thunderbird/enigmail, I can't make the gpg-agent forget my passphrase, enigmail tells me I'm using gpg-agent for passphrase management so enigmail can't forget my passphrase.

Is there a way to make gpg-agent forget my passphrase periodically? To be honest, I only skimmed the manpage but it looked like there was nothingin there.

1
  • man gpg-agent | less -p default-cache...
    – jasonwryan
    Jul 18, 2014 at 7:26

3 Answers 3

7

You can use the --default-cache-ttl option to set how long to keep an entry around:

eval $(gpg-agent --default-cache-ttl 300)

will cache for five minutes. You can also set this in your gpg-agent.conf file:

default-cache-ttl 300

The default is ten minutes (600 seconds). These timeouts will be reset when you use the key. max-cache-ttl sets the upper limit before reentering the passphrase.

2
  • Can you explain what do you mean by this: "these timesout will be reset when you use the key". Do you mean if we run any gpg command it will auto reset ?
    – MaXi32
    Oct 3, 2020 at 6:34
  • @MaXi32 yes. Oct 3, 2020 at 8:02
5

If you want to make gpg-agent forget your passphrase on demand (for instance, when your screensaver activates) you can send it a SIGHUP:

killall -s HUP gpg-agent

That'll generate a log file entry like this:

2014-09-19 16:14:22 gpg-agent[1100] SIGHUP received - re-reading configuration and flushing cache

1

You can just kill it. This is the canonical way to kill gpg-agent:

gpgconf --kill gpg-agent
2
  • 1
    Sounds like that would do more than make it forget one passphrase!?!
    – Jeff Schaller
    Nov 2, 2018 at 18:20
  • True, but it's likely OP has only one passphrase. None of the solutions offered here allow you to forget just one passphrase. There should be a way to do that using gpg-connect-agent however (the CLEAR_PASSPHRASE command).
    – MMGen
    Nov 2, 2018 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .