Created
September 10, 2022 10:34
-
-
Save MathiasReker/c891b5bcb497209a279b8a524e95f2d0 to your computer and use it in GitHub Desktop.
Add GitHub signing SSH key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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." |
Author
MathiasReker
commented
Sep 10, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment