Skip to content

Instantly share code, notes, and snippets.

@S1M0N38
Created November 13, 2022 11:11
Show Gist options
  • Save S1M0N38/165024e05d29159441af9972da3847eb to your computer and use it in GitHub Desktop.
Save S1M0N38/165024e05d29159441af9972da3847eb to your computer and use it in GitHub Desktop.
Setup GPG keys on MacOS
brew install gnupg pinentry-mac                    && \
mkdir $GNUPGHOME                                   && \
echo "pinentry-program /usr/local/bin/pinentry-mac" > \
     "$GNUPGHOME/gpg-agent.conf"
  • Generating new GPG key (RSA and RSA, 4096 bits)
gpg --full-generate-key
  • Fixing permissions
chown -R $(whoami) $GNUPGHOME && \
chmod 700 $GNUPGHOME          && \
chmod 600 $GNUPGHOME/*        && \
chmod 700 $GNUPGHOME/*.d
  • Copy public key in the clipboard
gpg --armor --export | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment