How to use GitHub with SSH Keys on Windows 10 |Video upload date:  · Duration: PT6M5S  · Language: EN

Set up SSH keys on Windows 10 for secure GitHub access Learn key generation agent setup and testing for password free Git operations

Want to stop typing your password every time you push and feel like a grown up? This guide walks you through generating SSH keys on Windows 10 adding the public key to your GitHub account and using those keys with Git Bash or the Windows OpenSSH client. It is secure practical and slightly smug.

Why use SSH keys instead of passwords

Passwords are annoying and often predictable. SSH keys are a pair of cryptographic keys that prove it is really you pushing code. Use a private key on your machine and register the matching public key with GitHub. The result is secure git access without password prompts once the agent is set up.

What you will need

  • Windows 10 with either Git for Windows and Git Bash or the built in OpenSSH client
  • A GitHub account
  • A terminal you can tolerate

Step 1 Install Git and open a shell

Install Git for Windows if you do not already have it. Git Bash gives you familiar ssh tools so most tutorials will work as shown. If you prefer you can enable the Windows OpenSSH client and use PowerShell. Either way you need a Unix like shell that understands ssh and ssh-add.

Step 2 Generate a strong key pair

Open your shell and run the recommended command. Replace the email with the one on your GitHub account.

ssh-keygen -t ed25519 -C "your_email@example.com"

If you must support older systems use RSA with a large key instead like this. It is less modern but sometimes necessary.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Accept the default file location unless you have a reason not to. Choose a passphrase for the private key if you want an extra layer of protection. You will be grateful for that passphrase in the unlikely event your laptop is less careful than you are.

Step 3 Start the ssh agent and add your private key

The agent keeps your key unlocked for the session so Git can push without asking for the passphrase every time.

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

On PowerShell use this to add the key to the agent if clip is not available or you prefer PowerShell commands.

Step 4 Copy the public key to your clipboard

Expose the public key and copy it. In Git Bash the clip tool works fine.

cat ~/.ssh/id_ed25519.pub | clip

In PowerShell you can use this variant.

Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard

Step 5 Add the key to your GitHub account

On GitHub open Settings then SSH and GPG keys then click New SSH key. Paste the clipboard contents into the key field and give it a clear title so you know which machine it is later. Save it. No magic API keys required just paste and confirm.

Step 6 Test the connection and update your repo remote

Check that GitHub recognizes your key with a friendly test command.

ssh -T git@github.com

You should see a welcome message that mentions your GitHub username. If you get a permission denied message go back and confirm the public key is pasted correctly and that the agent has your private key loaded.

Now switch your repository remote to use SSH. On your local repo run this and replace USERNAME and REPO with the correct values.

git remote set-url origin git@github.com:USERNAME/REPO.git

Alternatively you can use the ssh URL format if you prefer explicit URLs.

git remote set-url origin ssh://git@github.com/USERNAME/REPO.git

Try a git push to confirm everything works and enjoy the sweet silence of no password prompts.

Troubleshooting and tips

  • If ssh returns a host key warning type yes to accept it once
  • Use a passphrase and rely on the ssh agent for convenience and safety
  • If you manage multiple machines give each key a descriptive title in GitHub
  • On corporate networks a firewall or proxy can interfere with SSH so test from a different network if things fail

That is it. You generated a key pair started an agent added the public key to GitHub and updated your repo to use SSH. Push away like the modern developer you are while actually doing something useful.

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.