Migrate to RunxBuild and earn up to $50 in hosting credit on your first deposit.

Calculate your savings
unxBuild

Creating SSH Keys on Windows: 4 Methods and the Right Default

Sean

Platform Writer

Jul 05, 2026
5 min read

Creating SSH keys on Windows has four methods: native OpenSSH (PowerShell/CMD - modern default), PuTTYgen (legacy .ppk output), WSL (Linux path), or Git for Windows. The team that uses native OpenSSH has the same workflow as Linux/macOS. The team that uses PuTTYgen only needs it for older PuTTY clients.

Creating SSH Keys on Windows: 4 Methods and the Right Default

Table of contents

Method 1: PowerShell ssh-keygen

Most common on Windows 10+:

ssh-keygen -t ed25519 -C "[email protected]"

Key lands in $HOME\.ssh\id_ed25519. The team that has Windows 10 1809+ or Server 2019+ has OpenSSH built in.

Method 2: CMD ssh-keygen

Same binary:

ssh-keygen -t ed25519 -C "[email protected]"

Key lands in %USERPROFILE%\.ssh\id_ed25519. The team that uses CMD for one-liners has this working too.

Method 3: PuTTYgen for .ppk output

When you need a .ppk for PuTTY or WinSCP:

  1. Open PuTTYgen.
  2. Parameters: ed25519, 256 bits.
  3. Click Generate, move mouse.
  4. Save private key as .ppk.

The team that uses modern Windows Terminal + native OpenSSH doesn’t need PuTTYgen.

Method 4: WSL ssh-keygen

Inside WSL:

ssh-keygen -t ed25519 -C "[email protected]"

Key lands in WSL’s home (/home/<user>/.ssh/). Accessible from Windows at \\wsl$\Ubuntu\home\<user>\.ssh\. The team that runs WSL as primary dev environment has Linux-style SSH keys.

Which method to use

The team that needs:

  • Modern SSH client (VS Code Remote, native OpenSSH): PowerShell ssh-keygen
  • Legacy PuTTY client: PuTTYgen
  • WSL-based dev environment: WSL ssh-keygen
  • Cross-platform consistency (Windows + Linux): PowerShell ssh-keygen, copy to WSL if needed

The team that picks one method and sticks with it has fewer ‘which key file is this?’ confusions.

Adding to GitHub or GitLab

After generation, copy the public key:

Get-Content $HOME\.ssh\id_ed25519.pub | Set-Clipboard

Paste into GitHub’s ‘New SSH key’ form. The team that uses ssh-copy-id (after installing Git for Windows) has a one-liner: ssh-copy-id user@server.

FAQ

What algorithm should I use?

ed25519 for new keys. The team that has older RSA keys can keep using them but new keys should be ed25519.

Where does the key go?

C:\Users\<you>\.ssh\id_ed25519. Show hidden files to see .ssh in Explorer.

Can I have multiple keys?

Yes. Use -f for custom path: ssh-keygen -t ed25519 -f C:\keys\github_ed25519. The team that has one key per service has better isolation.

Why does GitHub say ‘key is already in use’?

The same key was added to another account. The team that uses one key per GitHub account avoids this.

How do I share a key between PowerShell and WSL?

Copy the key file from ~/.ssh on PowerShell side to ~/.ssh on WSL side. Then chmod 600 on the WSL copy.

If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.

Useful related references:

#ssh#windows#keygen#dev-infra