Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk7 min

How to Generate SSH Keys on Windows 11

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SSH keys are the standard way to authenticate to servers without retyping passwords. On Windows 11, you can generate them using the OpenSSH tools that ship with the OS, then copy the public key to the systems (or services) you want to access.

This guide shows you the quickest, most reliable paths to generate SSH keys on Windows 11, plus how to verify, install, and troubleshoot when things don’t work.

As an Amazon Associate I earn from qualifying purchases.

What SSH keys you should generate on Windows 11

Before you run commands, pick a key type that matches common modern defaults. Most users should start with ed25519, which is faster and uses shorter keys than RSA while staying widely supported.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Key type Best for Common command
ed25519 General-purpose SSH access, Git, most servers ssh-keygen -t ed25519
RSA Legacy systems that require RSA ssh-keygen -t rsa -b 4096

If you’re unsure, generate ed25519 first. You can always generate an additional RSA key later if a specific server requires it.

#1 Best Overall

Prerequisites on Windows 11

Windows 11 usually includes OpenSSH client tools, but availability depends on your install and updates. You need ssh-keygen to create keys.

Confirm OpenSSH client is installed

Open PowerShell or Windows Terminal and run:

ssh-keygen -h

If the command is found, you’re ready. If you get “not recognized” or similar, install OpenSSH Client.

Install OpenSSH Client (if needed)

  1. Open Settings → Apps → Optional features.
  2. Scroll to OpenSSH Client.
  3. If it’s not installed, click View features (or Add an optional feature), then install OpenSSH Client.
  4. Restart your terminal and re-run ssh-keygen -h.

Method 1: Generate SSH keys with built-in OpenSSH (PowerShell or Windows Terminal)

This is the cleanest approach on Windows 11 because it uses the same tooling everywhere: the OpenSSH client bundled with the OS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step-by-step: generate an ed25519 key

  1. Open PowerShell or Windows Terminal.
  2. Choose where to store keys. The standard location is %USERPROFILE%\.ssh (for example C:\Users\YourName\.ssh).
  3. Run this command (replace nothing unless you want a different filename):
    ssh-keygen -t ed25519 -a 100 -f $env:USERPROFILE\.ssh\id_ed25519
  4. When prompted for a passphrase, choose one of these options:
    • Recommended: enter a strong passphrase to protect the private key.
    • Optional: press Enter to use an empty passphrase (not recommended for long-lived access).
  5. When prompted to confirm, Windows/ssh-keygen will create two files in .ssh:
    • id_ed25519 (private key)
    • id_ed25519.pub (public key)

Notes on the flags: -t ed25519 selects the key algorithm. -a 100 sets the bcrypt KDF rounds for passphrase hashing (higher can be slower, but gives stronger protection).

Generate an RSA key instead (for legacy requirements)

If a server requires RSA, generate a 4096-bit RSA key:

ssh-keygen -t rsa -b 4096 -a 100 -f $env:USERPROFILE\.ssh\id_rsa

It produces id_rsa and id_rsa.pub the same way as the ed25519 flow.

Use a custom filename for multiple accounts

If you access multiple servers or providers, use different filenames so you can select the correct key later:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh-keygen -t ed25519 -f $env:USERPROFILE\.ssh\work_ed25519

You’ll get work_ed25519 and work_ed25519.pub.

Method 2: Generate SSH keys in Git Bash

If you already use Git for Windows, Git Bash also ships with an OpenSSH-compatible ssh-keygen. It’s useful when your workflow is already Git-centric.

Step-by-step in Git Bash

  1. Install Git for Windows (if needed) and open Git Bash.
  2. Run:
    ssh-keygen -t ed25519 -a 100 -f ~/.ssh/id_ed25519
  3. When prompted, enter a passphrase or press Enter for none.
  4. Confirm the files exist:
    ls -la ~/.ssh

Git Bash uses the same default .ssh location under your user profile, just expressed with Unix-style paths.

Method 3: Generate SSH keys inside WSL (Ubuntu on Windows)

If you use WSL heavily (for dev boxes, containers, or CI), generating keys inside WSL can be more convenient because your SSH config and file permissions behave like a Linux system.

Step-by-step inside WSL

  1. Open your WSL distro (for example Ubuntu).
  2. Generate an ed25519 key:
    ssh-keygen -t ed25519 -a 100 -f ~/.ssh/id_ed25519
  3. Enter a passphrase when prompted.
  4. To see the public key:
    cat ~/.ssh/id_ed25519.pub

When you later install the public key on servers, use the public key content from the .pub file. Keep the private key in WSL or your SSH client’s secure location.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choosing file paths, passphrases, and formats

Small choices here prevent a lot of headaches later, especially when you have multiple keys and multiple remote systems.

Where keys are stored

On Windows, the default is typically %USERPROFILE%\.ssh. For example, C:\Users\Sam\.ssh. You’ll see:

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.
  • id_ed25519 or id_rsa (private)
  • id_ed25519.pub or id_rsa.pub (public)

Use passphrases for better security

Even if your Windows account is locked down, a passphrase protects the private key if it’s copied. If you don’t want to type passphrases constantly, you can use ssh-agent (see troubleshooting).

Match key format to server expectations

Most modern servers accept ed25519. If you’re targeting older appliances or special gateways, they may require RSA. In those cases, generate RSA (4096) as shown above.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify your keys and view the public key

Verification prevents the most common failure mode: uploading the wrong file or copying the private key by mistake.

Check that files exist

dir $env:USERPROFILE\.ssh

You should see both the private key and its matching .pub file.

Confirm permissions (Windows can be picky)

OpenSSH on Windows expects the private key file permissions to be reasonable. If permissions are too open, the SSH client can refuse to use the key.

Try generating the key under your user profile (%USERPROFILE%\.ssh) rather than a shared folder, and avoid putting keys under Downloads or a synced public directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Display the public key safely

Display the contents of your public key:

type $env:USERPROFILE\.ssh\id_ed25519.pub

Copy everything on the single line that starts with ssh-ed25519 (or ssh-rsa for RSA keys).

Install your public key on the server (and test)

Generating keys is only half the job. You must install the public key on the remote system you want to log into.

Add your public key to a user’s authorized_keys

On the remote machine, append your public key to the account you’ll log in as. Common paths are:

  • ~/.ssh/authorized_keys

Typical approach on Linux/Unix:

  1. Ensure the directory exists:
    mkdir -p ~/.ssh
  2. Set correct permissions:
    chmod 700 ~/.ssh
  3. Append your public key content:
    nano ~/.ssh/authorized_keys
  4. Save and set permissions:
    chmod 600 ~/.ssh/authorized_keys

On Windows hosting (or managed services), the UI often provides a field to paste the public key. Use the full single-line content from your .pub file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test the connection from Windows 11

From PowerShell/Windows Terminal:

ssh -i $env:USERPROFILE\.ssh\id_ed25519 [email protected]

If DNS/hostnames are correct and your public key is installed, you should authenticate without a password (or with only your key passphrase).

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common mistakes and troubleshooting

If authentication fails, the error message usually points to one of a few predictable problems: the wrong key, key not installed, permissions too open, or an SSH config mismatch.

Problem: ssh-keygen command not found

Install OpenSSH Client via Settings → Apps → Optional features, then reopen the terminal. Re-run ssh-keygen -h.

Rank #3
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage | LPDDR4 RAM, 180° Lay-Flat, Dual-Band WiFi, Type-C PD Fast Charging, Thin & Lightweight for Students, Home & Office, Gray
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.

Problem: copied the wrong file to authorized_keys

Make sure you paste from the .pub file. Never paste the private key (no extension) into authorized_keys.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Problem: Permissions errors like “bad permissions”

Windows paths and inherited permissions can trip SSH. Keep keys in %USERPROFILE%\.ssh. Avoid storing keys in synchronized folders (like some cloud-synced directories) unless you know how permissions are applied.

If you moved keys, consider regenerating them into %USERPROFILE%\.ssh and re-uploading the public key.

Problem: SSH uses the wrong key when you have multiple keys

When you have more than one identity, specify -i explicitly:

ssh -i $env:USERPROFILE\.ssh\work_ed25519 [email protected]

You can also create an SSH config file.

Use a per-host SSH config (recommended for multi-server setups)

Create or edit:

$env:USERPROFILE\.ssh\config

Example:

Host work-server HostName your.server.example User youruser IdentityFile C:/Users/YourName/.ssh/work_ed25519 IdentitiesOnly yes

Then connect with:

ssh work-server

Problem: you don’t want to type passphrases every time

Use ssh-agent and add keys once per session. In PowerShell:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Get-Service ssh-agent | Set-Service -StartupType Automatic

Start-Service ssh-agent

ssh-add $env:USERPROFILE\.ssh\id_ed25519

If you generated multiple keys, add the ones you need with separate ssh-add commands.

Problem: server rejects the key algorithm

If the server only allows certain algorithms, retry with RSA (4096). On the Windows side, generate the RSA key and upload id_rsa.pub to the server.

FAQ

Do I need an SSH key if I only use GitHub?

Yes—GitHub typically expects SSH authentication. After generating your key, add the public key to your GitHub account settings, then test with ssh -T [email protected].

What’s the difference between the files id_ed25519 and id_ed25519.pub?

id_ed25519 is your private key and must stay secret. id_ed25519.pub is your public key; it’s what you paste into authorized_keys or provider account settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I generate SSH keys on Windows 11 without OpenSSH?

You can, but the OpenSSH tools are the standard and most reliable option on Windows 11. If you already have Git for Windows, Git Bash includes an equivalent ssh-keygen, which is still part of the OpenSSH tooling ecosystem.

Should I generate both ed25519 and RSA?

Only if you have specific compatibility needs. ed25519 covers most modern servers. Add RSA if a legacy target requires it.

Bottom Line

On Windows 11, the fastest reliable way to generate SSH keys is using the built-in OpenSSH client: run ssh-keygen in PowerShell or Windows Terminal, store files in %USERPROFILE%\.ssh, then copy the single-line content from the matching .pub file to your server or provider.

If something fails, check you uploaded the correct .pub key, confirm you’re pointing SSH at the right identity with -i or an SSH config, and watch for permission issues by keeping keys in your user’s .ssh directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.