Skip to content

Instantly share code, notes, and snippets.

@Steve-Roderick
Created April 29, 2024 15:21
Show Gist options
  • Save Steve-Roderick/cc27d17bb450e0b0db9d253245c157e6 to your computer and use it in GitHub Desktop.
Save Steve-Roderick/cc27d17bb450e0b0db9d253245c157e6 to your computer and use it in GitHub Desktop.
Setup github ssh keys Reminder
# Reminder on how to setup github ssh keys in bash.
mkdir -p ~/.ssh
ssh-keygen -t ed25519 -C "<COMMENT>"
# Add public Key to github
# ...
# Permissions Reminder
# https://superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder
# https://superuser.com/users/922699/
chmod 700 ~/.ssh
chmod 644 ~/.ssh/*.pub
chmod 600 ~/.ssh/<private>
ls -l ~/../
# lastly your home directory should not be writeable by the group or others (at most 755 (drwxr-xr-x)
# ssh config file
cat <<EOF >~/.ssh/config
Host github
HostName github.com
User git
Port 22
IdentityFile ~/.ssh/<private>
Host github.com
HostName github.com
User git
Port 22
IdentityFile ~/.ssh/<private>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment