Skip to content

Add SSH Keys for Git Authentication

Windows

Setup SSH key

Forge Your New SSH Key

ssh-keygen -t ed25519 -C "your-email@example.com"

start the SSH agent

Set-Service -Name ssh-agent -StartupType Automatic  
Start-Service ssh-agent

Add the key

ssh-add $HOME\.ssh\id_ed25519

Grab Your Public Key

cat ~/.ssh/id_ed25519.pub

GitHub

  • Navigate to GitHub → Settings → SSH and GPG keys.
  • Click New SSH Key, paste your key, and hit save.

GitLab

  • Go to GitLab → Preferences → SSH Keys.
  • Paste your key and save it.

Bitbucket

  • Head to Bitbucket → Personal Settings → SSH Keys.
  • Click Add Key, paste, and save.

Test the connection

Github:

ssh -T git@github.com

GitLab

ssh -T git@gitlab.com

Bitbucket

ssh -T git@bitbucket.org

If you get this message, means all OK

Hi username! You've successfully authenticated, but GitHub/GitLab/Bitbucket does not