Skip to content

Instantly share code, notes, and snippets.

@joshbaptiste
Last active May 11, 2021 00:33
Show Gist options
  • Save joshbaptiste/13672a2874f068c8a4e8c8a0b24633a3 to your computer and use it in GitHub Desktop.
Save joshbaptiste/13672a2874f068c8a4e8c8a0b24633a3 to your computer and use it in GitHub Desktop.
Github with ssh keys

Setup github with SSH keys in Linux/FreeBSD

Create the keys I prefer ed25519

ssh-keygen -f ~/.ssh/id_ed22519_github -t ed25519 -C "MyGithubLoginEmail@mygmail.com"

Paste public ~/.ssh/id_ed22519_github.pub key string to github https://github.com/settings/keys

Test the connection you should see "Hi username! You've successfully authenticated"

ssh -i ~/.ssh/id_ed22519_github -T git@github.com

add the following to ~/.ssh/config

Host github
    HostName github.com
    User git
    IdentityFile /home/user/.ssh/id_ed22519_github
    IdentitiesOnly yes

cd to project dir

git remote add github git@github:GithubUsername/projectName.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment