Creating SSH keys for GitHub in Windows is hard. Bloody hard.

Tino
2 min readApr 11, 2021
A sketch crated by Captain V illustrating a futuristic all-in-one windows pc and a droid that talks using his nose saying: SSH.
A sketch crated by Captain V illustrating a futuristic all-in-one windows pc and a droid that talks using his nose saying: SSH

Well not really. I understand all the obsession with Linux simplicity and Unix systems in general but if you stop being a fanboy of all *nix systems you realise that the dev experience under Windows is quite amazing and these days is smooth as fuck (I personally use Windows, Linux and Apple machines on a daily basis so I know what I am talking about). Let me show you how to create and add an SSH key to your GitHub account on a Windows machine. What is an SSH key? Well just google it but basically you will be able to clone and push repos to GitHub without needing to authenticate yourself every time. It’s like a passport for you machine to be recognised in the GitHub world.

First of all let’s just use PowerShell. It comes with Windows and you don’t have to worry much to install any unnecessary stuff.

Step 1

Open your PowerShell and add

ssh-keygen.exe -t ed25519 -C "your-fake-email@example.com"

As you can see the email part is just so you remember which key it is as you will see the the generated file contains some random characters. It’s a little note for yourself for later. In all honesty you will probably never look at it, but hey, it’s nice to add a little differentiator in case you will have to manage 1001 SSH keys.

Once you run this command it will ask you many boring questions. Just press Enter and move on. Life is too short to answer all the questions for every command line tool.

Step 2

Now let’s copy the generated gibberish into our clipboard so we can paste it in GitHub.

Get-Content ~\.ssh\id_ed25519.pub | Set-Clipboard

Obviously you SSH key filename might be named differently so just make sure it’s the correct one. You know, you can type id and then press Tab a few times. The magical power of autocomplete will save your day.

Step 3

Bingo. That’s pretty much it. Now go to your GitHub settings and add it. It’s usually located under SSH and GPG keys.

A screenshot from GitHub.com showing the SSH and GPG keys settings page
A screenshot from GitHub.com showing the SSH and GPG keys settings page

You’re welcome.

Love. Tino

--

--

Tino

Software Developer and Helicopter pilot. Inventor of bubbology.