If you are tired of typing your password every time Git nags you like a needy app then SSH keys are the calm, efficient solution. This guide walks developers through generating an SSH key with ssh-keygen adding it to the agent copying the public key into GitHub and switching repos to SSH so pushes and pulls stop asking for passwords during normal development work.
SSH keys let your machine prove who it is without shouting a password every time. They are stronger than passwords when generated with modern algorithms and they make automation and CI a lot less painful. Use ed25519 by default for better security and smaller keys. If you must support ancient environments fall back to RSA with a large key size.
Open a terminal on Linux macOS or Git Bash on Windows and run one of these commands. Pick ed25519 unless you have a compatibility headache.
ssh-keygen -t ed25519 -C "your_email@example.com"
# fallback if you need RSA for some ancient server
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
The command creates a private key and a matching public key under your home folder in .ssh. Use the default file name unless you want multiple keys for multiple machines. When prompted add a passphrase unless you plan to live dangerously.
The SSH agent keeps your unlocked key in memory so you are not typing the passphrase every five minutes. Start it and add your key like this.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
On Windows you can use Git Bash which includes OpenSSH or enable the built in OpenSSH agent in Windows. If you use PuTTY tools you will load a .ppk into Pageant instead.
Dump the public key to the terminal and copy the whole line into your GitHub account settings under SSH and GPG keys. Give the key a descriptive title so future you remembers which laptop or VM this was.
cat ~/.ssh/id_ed25519.pub
Log into GitHub go to Settings then SSH and GPG keys then New SSH key and paste the contents. If you use multiple accounts use different keys or an SSH config entry.
Verify GitHub accepts your key with a test connection. The first time you will confirm the host fingerprint.
ssh -T git@github.com
A successful message will tell you which GitHub account matched the key. If you see permission denied then double check which key the agent has loaded and that you copied the public key correctly.
If your repository still uses HTTPS change the remote to the SSH clone URL shown on the repository page. Copy that SSH URL from GitHub and run this command in the repo. Do not type the SSH URL by hand unless you enjoy typos.
git remote set-url origin
After that pushes and pulls will authenticate with your SSH key instead of asking for your username and password.
Use Git Bash for familiar commands on Windows. Modern Windows includes OpenSSH so the same ssh-keygen and ssh-add flow can work. If you prefer PuTTY use puttygen to create or convert keys and use Pageant as the agent. Keep the private key file safe and never paste it anywhere public.
This setup reduces password hell and keeps your Git operations smooth while maintaining strong developer security. Now go forth and push code with confidence and slightly less suffering.
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.