Skip to content

Instantly share code, notes, and snippets.

@ToshY
Created September 23, 2021 20:26
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 ToshY/6f1128b39a8dc13566558d2041ca1fab to your computer and use it in GitHub Desktop.
Save ToshY/6f1128b39a8dc13566558d2041ca1fab to your computer and use it in GitHub Desktop.
GPG key non-interactive one-liner with variable substitution
printf "Key-Type: 1\nKey-Length: 2048\nSubkey-Type: 1\nSubkey-Length: 2048\nName-Real: %s\nName-Email: %s\nExpire-Date: 0\nPassphrase: %s" $USER_GPG $EMAIL_GPG $PASSPHRASE_GPG | gpg --batch --gen-key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment