Generate an Ed25519 SSH key pair for GitHub authentication:
Terminal window
ssh-keygen-ted25519-C"your.email@example.com"
When prompted:
File location: Press Enter to accept the default (~/.ssh/id_ed25519)
Passphrase: Enter a passphrase (recommended) or press Enter for none
Start the SSH agent and add your key:
Terminal window
eval"$(ssh-agent-s)"
ssh-add~/.ssh/id_ed25519
WSL2 does not persist the SSH agent across sessions. Each time you open a new terminal, you may need to re-run eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_ed25519. To automate this, add the following to your ~/.bashrc: