g Verified current stable Not installed? Security

G / Generate New Key Interactively

Generate New Key Interactively

Generate a new GPG key using an interactive prompt.

$
Terminal
<g>

When To Use

When creating a new keypair for high-stakes data transactions.

Pro Tip

Use advanced options for key size and expiration to ensure strong security; e.g., 'gpg --full-generate-key' for more customization during generation.

Anatomy of Output

Understanding the result

Generating key... Please wait. Progress Message

Indicates key generation process has started.

Key Type: RSA, Size: 4096 Key Specifications

Shows the key type and size chosen.

Operation complete: Key generated successfully. Completion Status

Indicates successful key generation.

Power User Variants

Optimized versions

g -G dsa

Generate a DSA key instead.

g --quick-gen-key

Quickly generate a key with default parameters.

Troubleshooting

Common pitfalls

gpg: error generating key: Bad parameters

Solution: Make sure all required values are provided, and format is correct.

gpg: cannot write key to keyring

Solution: Check permissions on the keyring location; run with `sudo` if necessary.

gpg: key generation failed

Solution: Ensure the system has adequate entropy; consider enhancing entropy.

Command Breakdown

What each part is doing

<g>
Base Command
The executable that performs this operation. Here it runs G before the shell applies any redirect operators.

Alternative Approaches

Comparable commands in other tools

Alternative security tools for the same job.