Add SSH Key to GitHub
Copy the public key to your clipboard:
cat ~/.ssh/id_ed25519.pub- Go to github.com → Settings → SSH and GPG keys
- Click New SSH key
- Title: Give it a descriptive name (e.g.,
WSL2 Ubuntu) - Key type: Authentication Key
- Key: Paste the public key output
- Click Add SSH key
Verify SSH Connection
Section titled “Verify SSH Connection”Test that GitHub recognizes your key:
ssh -T git@github.comExpected:
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?), typeyesand 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)