How to Safely Delete a GPG Key on Linux (Step-by-Step)
If you need to remove a GPG key from your Linux system, GPG enforces a strict safety workflow. You cannot delete a public key while its corresponding private key still exists. You must delete the private key first, and then remove the public key. Follow this guide to wipe any GPG key cleanly. TL;DR / Quick Command Summary: Find GPG key id: gpg --list-secret-keys --keyid-format LONG Delete the Private key: gpg --delete-secret-keys <key id> Delete the Public key: gpg --delete-keys <key id> Step 1: Find Your GPG Key ID Before deletion, you need to identify the exact Key ID you want to remove. Run the following command to list your secret keys:
How to Generate a GPG Key on Linux (Step-by-Step)
Need to sign your Git commits or encrypt private files? This guide shows you how to generate a secure GPG key on Linux using the command line. TL;DR / Quick Command Summary: Generate key: gpg --full-generate-key Verify key: gpg --list-secret-keys --keyid-format LONG Step 1: Start the GPG Key Generation Wizard Open your Linux terminal and execute the following command to launch the full-featured key generation dialog: gpg --full-generate-key Step 2: Choose Your Key Configuration The terminal will prompt you with several options. To create a modern, highly secure and high-performance key, follow these inputs: