I set up a new windows dev box today, and one of the first things I do is setup Git with GitHub SSH authentication, and its surprisingly fiddly! Between PowerShell, Git Bash, OpenSSH, and Windows services, it’s easy for keys to end up in the wrong place or for the SSH agent to silently fail.
This guide walks through the exact steps to get SSH authentication working quickly and reliably on Windows 10/11 using PowerShell and the built‑in OpenSSH agent.
Using SSH means:
Once it’s set up, it’s done and you never have to think about it again.
When installing Git for Windows, two options matter:
This uses Windows’ built‑in OpenSSH, which integrates with:
C:\Users\<you>\.ssh folderThe bundled OpenSSH is only useful if you live entirely inside Git Bash.
For a modern Windows dev setup, external OpenSSH is the correct choice.
This makes Git use Windows’ certificate store, which means:
OpenSSL is only needed for niche workflows.
For almost everyone, WinSSL is the right choice.
.ssh FolderWindows doesn’t always create this automatically, so start by ensuring it exists:
mkdir $env:USERPROFILE\.ssh -Forcefirst, lets explicitly generate the key inside the .ssh folder:
ssh-keygen -t ed25519 -C "your-email@example.com"You should now have:
C:\Users\<you>\.ssh\id_ed25519
C:\Users\<you>\.ssh\id_ed25519.pubThe OpenSSH Authentication Agent is a Windows service. It must be enabled and running.
Open PowerShell as Administrator and run:
Set-Service -Name ssh-agent -StartupType Automatic
Start-Service ssh-agentVerify:
Get-Service ssh-agentExpected:
Status Name DisplayName
------ ---- -----------
Running ssh-agent OpenSSH Authentication AgentBack in a normal PowerShell session:
ssh-add $env:USERPROFILE\.ssh\id_ed25519If you get a permissions error, fix the ACL:
icacls $env:USERPROFILE\.ssh\id_ed25519 /inheritance:r /grant:r "$($env:USERNAME):(R,W)"
ssh-add $env:USERPROFILE\.ssh\id_ed25519Copy the public key to your clipboard:
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-ClipboardThen go to:
GitHub → Settings → SSH and GPG keys → New SSH key
Paste it in.
ssh -T git@github.comYou’ll see:
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.That’s the success message.
Optional but recommended:
git config --global url."git@github.com:".insteadOf "https://github.com/"If you cloned any repos using HTTPS, switch them:
git remote set-url origin git@github.com:<user>/<repo>.gitWindows SSH setup can feel like a maze the first time through, but once the agent is running and your keys are in the right place, it’s a one‑time setup that makes Git operations frictionless.