Skip to content

Instantly share code, notes, and snippets.

@nikAizuddin
Created November 24, 2022 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikAizuddin/25fcb51d0cbf95d6d27f45ac0ede2413 to your computer and use it in GitHub Desktop.
Save nikAizuddin/25fcb51d0cbf95d6d27f45ac0ede2413 to your computer and use it in GitHub Desktop.
Create PGP key and get it's public key

Instructions how to create GPG keys for john@example.com (change with your own business email).

Prerequisites

Install GPG on your machine. See blog from Yubico on how to install GPG.

Creating PGP key

Execute the following command:

gpg --full-generate-key

Use the following options:

  • Please select what kind of key you want: RSA and RSA
  • What keysize do you want?: 4096
  • Please specify how long the key should be valid: 0
  • Real name: John Sample
  • Email address: john@example.com
  • Comment:
  • Passphrase: abcde12345

WARNING:

  • Change abcde12345 with your own secure passphrase to protect your private key.
  • Do not set GPG comment. See MISP.

To export GPG public key to my-pubkey.pgp file:

gpg --output my-pubkey.pgp --armor --export john@example.com

You can now export my-pubkey.pgp to your teams or anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment