Skip to content

Add SSH Key to GitHub

Copy the public key to your clipboard:

Terminal window
cat ~/.ssh/id_ed25519.pub
  1. Go to github.com → Settings → SSH and GPG keys
  2. Click New SSH key
  3. Title: Give it a descriptive name (e.g., WSL2 Ubuntu)
  4. Key type: Authentication Key
  5. Key: Paste the public key output
  6. Click Add SSH key

Test that GitHub recognizes your key:

Terminal window
ssh -T git@github.com

Expected:

Hi <your-username>! You've successfully authenticated, but GitHub does not provide shell access.
  • If you see a host key confirmation prompt (Are you sure you want to continue connecting?), type yes and press Enter
  • If you get Permission denied (publickey), verify the key was added correctly on GitHub, and that your SSH agent has the key loaded (ssh-add -l)