In August 2021, GitHub permanently deprecated account password authentication for Git operations. Today, professional developers authenticate via SSH (Secure Shell) Key Pairs. SSH provides superior cryptographic security and enables passwordless, seamless pushing and pulling from your terminal.
SSH authentication relies on an asymmetric mathematical key pair:
id_ed25519): Stored securely on your local computer. You must NEVER share, email, or expose this file to anyone!id_ed25519.pub): Uploaded to your GitHub account. When you connect, GitHub uses your public key to encrypt a challenge that only your private key can decrypt.The ed25519 algorithm provides state-of-the-art security, shorter key lengths, and resistance to side-channel attacks compared to legacy RSA.
# Run ssh-keygen using your GitHub email address:
$ ssh-keygen -t ed25519 -C "your_email@example.com"
When prompted:
~/.ssh/id_ed25519).# Start the background ssh-agent service:
$ eval "$(ssh-agent -s)"
# Add your private key to the agent:
$ ssh-add ~/.ssh/id_ed25519
# On Windows (Git Bash):
$ clip < ~/.ssh/id_ed25519.pub
# On macOS:
$ pbcopy < ~/.ssh/id_ed25519.pub
# On Linux:
$ cat ~/.ssh/id_ed25519.pub
# Copy the printed line starting with 'ssh-ed25519 AAAAC3Nza...'
Verify your authentication with GitHub's servers:
$ ssh -T git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Congratulations! You are now securely authenticated with GitHub via SSH.
If you previously cloned your repository using HTTPS, update the remote URL to SSH to start using your key:
git remote set-url origin git@github.com:username/repository.git
Strengthen your version control mastery by studying these connected classes:
Alternative HTTPS authentication method using fine-grained security tokens.
Switch repository remotes from HTTPS URLs to git@github.com: SSH endpoints.
Add your SSH public key to GitHub account profile settings.
Fix Permission denied (publickey) errors using ssh-add and config files.
Advance your software engineering skills with the next topic in our synchronized curriculum.
Continue to PAT & Credentials → Previous: ← Tagging & Releases | Full Syllabus