Last active
February 5, 2025 16:32
-
-
Save cppshane/a26dde07705221f6657faa20a0285a29 to your computer and use it in GitHub Desktop.
GPG/SSH Setup
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
# Generate GPG key | |
# Sample Output: | |
# /home/shane/.gnupg/pubring.kbx | |
# ------------------------------ | |
# sec rsa3072/12345ABCDE 2021-11-12 [SC] [expires: 2023-11-12] | |
# 123456789 | |
# uid [ultimate] Shane Duffy <[email protected]> | |
# ssb rsa3072/12345ZZZZZ 2021-11-12 [E] [expires: 2023-11-12] | |
gpg --gen-key | |
gpg --list-secret-keys --keyid-format LONG | |
# Output key, add result to GitHub | |
gpg --armor --export 12345ABCDE | |
# Set as signing key | |
git config --global user.signingkey 12345ABCDE | |
git config --global commit.gpgsign true | |
## Generate SSH key | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
# Output key, add result to GitHub | |
cat ~/.ssh/id_rsa.pub | |
# Add to SSH Agent | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment