If you are tired of typing your password every time git nags you then SSH keys are the tiny miracle you need. This guide walks through generating a modern ed25519 key, loading it into the ssh agent, adding the public key to your GitHub account, and testing the connection. Expect slightly less frustration and marginally more security.
First do not overwrite something that already works. Check for existing identities in the default SSH folder so you do not accidentally retire a key that still pushes critical code.
ls -al ~/.ssh
ed25519 gives you a small fast key with strong crypto. Use ssh-keygen and give it a helpful comment like your email. Use a passphrase if you do not enjoy living dangerously.
ssh-keygen -t ed25519 -C "your_email@example.com"
When prompted pick a file name if you want multiple keys for different accounts. A passphrase is optional but recommended because a stolen private key with no passphrase is the developer equivalent of leaving your front door open and the welcome mat out.
The ssh agent holds your unlocked keys so you do not have to type the passphrase for every git operation. Start the agent and add your key.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
On macOS you can integrate with the keychain and on Linux use your desktop keyring for persistence. If you reboot and the agent forgot your key that is normal, so add it again or configure auto loading per your platform.
Copy the public key and paste it into the GitHub web UI under SSH and GPG keys. Give the key a clear title so you do not have to play treasure hunt later.
cat ~/.ssh/id_ed25519.pub
Use distinct titles like Work Laptop or Home Desktop so you can revoke one key without setting the world on fire.
Verify that GitHub knows your key and that authentication actually works before pushing anything important. You should see a friendly confirmation message or a polite refusal if something is wrong.
ssh -T git@github.com
If the host is unknown accept the host key when prompted or add it to known hosts first with ssh-keyscan. If GitHub responds with a short welcome you are all set.
cat >> ~/.ssh/config <
Using SSH keys removes password prompts and cuts down on leaked credentials. The private key stays on your machine and GitHub only needs the public key to verify you. That means safer pushes pulls and less time retyping passwords while you stare into the void.
If you want a one line summary without the snark here it is. Generate an ed25519 key add it to the ssh agent upload the public key to GitHub and test the connection. Then go do something more exciting than typing a password three times a day.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.