Skip to content

Instantly share code, notes, and snippets.

@MathiasReker
Created September 10, 2022 10:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MathiasReker/c891b5bcb497209a279b8a524e95f2d0 to your computer and use it in GitHub Desktop.
Save MathiasReker/c891b5bcb497209a279b8a524e95f2d0 to your computer and use it in GitHub Desktop.
Add GitHub signing SSH key
#!/bin/bash
# Name of SSH key
key=github_ed25519 # You can rename this
# Generate new SSH key
ssh-keygen -t ed25519 -f ~/.ssh/${key} -q -P ""
# Authorized it
cat ~/.ssh/${key}.pub >>~/.ssh/authorized_keys
# Configure ~/.gitconfig
git config --global user.signingkey "~/.ssh/${key}.pub"
git config --global gpg.format "ssh"
git config --global commit.gpgsign "true"
# Get SSH key
echo "! First copy your ssh-key:"
cat ~/.ssh/$key.pub #| clip
# Add new signing key on GitHub
echo "Open this URL to continue in your web browser: https://github.com/settings/keys"
echo "Create new SSH key. The key type must be signing key."
@MathiasReker
Copy link
Author

image

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