Developers frustrated by password deprecation on GitHub and wanting seamless, secure SSH-authenticated Git workflows.
- ✓Git installed locally
- ✓A free GitHub account
🚀 What You Will Learn & Build
- ▸Why GitHub deprecated account password authentication
- ▸Generating modern, secure Ed25519 SSH keys
- ▸Adding public keys to GitHub and configuring ssh-agent
- ▸Fixing 'Permission denied (publickey)' errors
1. Generating an Ed25519 SSH Key Pair
# 1. Generate modern Ed25519 key (replace with your GitHub email)
ssh-keygen -t ed25519 -C "your_email@example.com"
# Press Enter to save in default file (~/.ssh/id_ed25519)
# Optionally enter a passphrase
# 2. Start the ssh-agent in the background
eval "$(ssh-agent -s)"
# 3. Add private key to agent
ssh-add ~/.ssh/id_ed25519
# 4. Copy public key to clipboard
# On macOS:
pbcopy < ~/.ssh/id_ed25519.pub
# On Linux:
cat ~/.ssh/id_ed25519.pub
# On Windows Git Bash:
clip < ~/.ssh/id_ed25519.pub2. Adding Your Key to GitHub Settings
3. Testing Authentication
✨ Expected Output & Verification
Running 'git push origin main' pushes your commits instantly without prompting for passwords or personal access tokens.
🧪 How to Test the Implementation
- 1Run `ssh -T git@github.com` and ensure it welcomes you by username
- 2Change remote URL from HTTPS to SSH: `git remote set-url origin git@github.com:username/repo.git`
⚠️ Common Errors & How to Fix Them
Root Cause: Private key not added to ssh-agent, or uploaded the private key instead of the .pub public key.
Fix: Run `ssh-add ~/.ssh/id_ed25519` and verify you pasted the contents of `id_ed25519.pub` into GitHub.
🛡️ Security Considerations & Best Practices
- !Never share or commit files named id_ed25519 (without .pub); that is your private key.
❓ Frequently Asked Questions (FAQ)
No, best security practice is to generate a distinct SSH key pair on each computer and add each public key to GitHub individually.
📌 Summary of Key Takeaways
- ✓Use Ed25519 keys for speed and modern security.
- ✓Add public key to GitHub; keep private key secret.
Official References & Further Reading
- 🔗GitHub SSH Documentation— Official GitHub SSH setup instructions.
Written by Manoj Neupane
AuthorSoftware developer and programming instructor, Nepal
Building software systems and SaaS platforms with Laravel, Next.js, and Node.js. Passionate about helping students and developers in Nepal master practical, real-world development skills.