Home - Zines

OpenGPG Key and Password Expire Time

I use OpenGPG to sign Git commits on Github and my passwords were expiring too quickly.

I originally tried to increase the key expire times, but this is when the key becomes invalid, not how long the password is cached.

Set Password Expire Time

Set Key Expire Time

You can list your keys with the following command.

gpg --list-keys

You can set how long a key lasts before it expires with the following command. GPG will prompt you for how long to allow the key to be valid.

gpg --edit-key [key-id] expire

Type quit to exit GPG and select y to save.

Written by Joel Dare on March 11, 2024 and last updated March 13, 2024.


Get battle-tested dev tips, terminal wizardry, and practical Mac hacks from a veteran engineer who speaks your language. Subscribe now and power up your toolkit—no fluff, just real code magic.

Show Me Your Hacks

JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy