Skip to content
Follow
Windows

Generate SSH Keys on Windows 11: A Step-by-Step Guide

Richard
Written by
Richard
Nov 12, 2021 Updated Sep 15, 2026 3 min read
How to Generate SSH Keys on Windows 11
How to Generate SSH Keys on Windows 11

SSH keys on Windows 11 are a pair of secure digital codes that let you sign in to servers and code websites like GitHub without typing a password. Your public key stays on the remote server, while your private key stays safe on your PC in the 📁C:\Users\USERNAME\.ssh folder.

Advertisement

Windows 11 includes a built-in OpenSSH tool so you do not need to download extra software. You can create your keys in just a few minutes using PowerShell, Command Prompt, or Windows Terminal.

⚡ Quick Answer

Use the OpenSSH client in Windows Terminal to generate SSH keys. Type ssh-keygen -t rsa -b 4096 and press Enter to create a public and private key pair.

Advertisement

How to create SSH keys in 🪟 Windows 11

You can generate SSH keys Windows 11 quickly by opening Command Prompt or PowerShell and running the built-in command tool. This creates a secure public and private key pair on your computer that lets you log in to servers safely without typing a password every time.

The steps below show you how to do that in Windows 11

In Windows, to generate an SSH key, simply run the commands below and press Enter.

💻Code
ssh-keygen

The command above will automatically create and generate a 2048-bit RSA key.

Advertisement

GitHub recommends generating an SSH key with the Ed25519 algorithm.

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

When you run the commands above, you'll be prompted with the following lines asking to enter a location to save the file.

When prompted to "Enter a file in which to save the key," press Enter to accept the default file location.

💻Code
Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\Richard/.ssh/id_ed25519):

 If you use the defaults, then it will save your keys in C:\User\<username>\.ssh

Advertisement

Next, you'll be asked to enter a passphrase. You typically leave this empty and press Enter. However, you can secure your SSH key by entering a passphrase so that you're prompted for the passphrase every time you want to use the key to authenticate.

💻Code
Created directory 'C:\Users\Richard/.ssh'.
Enter passphrase (empty for no passphrase):

After that, you should see a screen similar to the one below. Your SSH key pair should be created and ready to use.

💻Code
Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\Richard/.ssh/id_ed25519):
Created directory 'C:\Users\Richard/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\Richard/.ssh/id_ed25519.
Your public key has been saved in C:\Users\Richard/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:fXTi96BC8pHrLtqyBOrtKBeWvYSMigOKt9U898rd1Jo admin@example.com
The key's randomart image is:
+--[ED25519 256]--+
|                 |
|                 |
|            o .  |
|         . + o   |
| o +.   S = o o  |
|o *.o+   + + + o |
|*..o..= . + o . .|
|B.o+...=.+ + o   |
| =+oo o+++= E    |
+----[SHA256]-----+
Generate SSH keys in Windows 11 PowerShell command prompt.
windows 11 ssh key generation powershell

Once the key generation process is complete, you can access the key pair at the location below.

💻Code
C:\Users\<username>\.ssh

Replace <username> with your Windows account name.

Advertisement
Default Windows 11 SSH key file location in user directory.
windows 11 ssh key location

That should do it!

Conclusion:

  • Generating SSH keys in Windows 11 is straightforward with the built-in OpenSSH tools.
  • Using the Ed25519 algorithm for SSH key generation is recommended for enhanced security.
  • Remember to save your keys in a secure location and choose a passphrase for added protection.
  • Once created, your SSH key pair can be easily accessed in the .ssh directory of your user profile.
  • Having SSH keys enables secure and convenient authentication when connecting to servers or using platforms like GitHub.

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Restart Windows Explorer in Windows 11
Windows How to Restart Windows Explorer in Windows 11
How to Change Windows Terminal Themes
Windows How to Change Windows Terminal Themes
How to Open Windows Terminal as Admin Automatically
Windows How to Open Windows Terminal as Admin Automatically
How to Setup PuTTY for SSH Key Authentication on Windows 11
Ubuntu Linux How to Setup PuTTY for SSH Key Authentication on Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

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