Follow these numbered steps to set up your SSH key for GitHub:
-
Set permissions
Ensure your private key is accessible only by you:chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub(Replace
id_rsawith your key name if different.) -
Start the SSH agent
Launch the agent to manage your keys:eval "$(ssh-agent -s)" -
Add your SSH key to the agent
ssh-add ~/.ssh/id_rsa -
Verify the key is added
ssh-add -l(Should display your key’s fingerprint.)
-
Test SSH connection to GitHub
ssh -T git@github.com(You should see a success or authentication message.)