Quick Links
The SSH (Secure Shell) key is an authentication credential used with the SSH protocol for securing file transfers, connecting networks, and managing most large cloud services like AWS. you’re able to generate them like passwords on Windows and create encrypted connections—here’s how.
How to Generate an SSH Key on Windows
The Secure Shell Protocol (SSH)is the best way to lock down an insecure connection between computers over the web. You should avoid using the protocol with a username and a password and instead opt for a cryptographically-generated SSH key.
Windows 11 comes with a built-in OpenSSH client. This makes it easy to generate SSH keys without using a third-party program. It should work the same way on Windows 10; if you have trouble,open the Windows optional features paneland enableOpenSSH Clientoption.

There are two ways to generate an SSH key on Windows—theCommand PromptandWSL(Windows Subsystem for Linux). Let’s start with the first method.
You might prefer the Windows Terminal as it provides a unified environment for command-line interfaces. It runs the Command Prompt, PowerShell, and the Windows Subsystem for Linux within a single window. This tool enhances versatility and simplifies tasks like generating SSH keys.

1. Generating an SSH Key Using the Command Prompt
To generate an SSH key on Windows using the Command Prompt, follow these steps:
The system will now generate your SSH key and provide you with a fingerprint and the location of the key. You can also view the key pair at the saved location.
In addition to RSA keys, you can also generate Ed25519 keys with it. The process is quite similar, with only a slight change to the command line. Instead of executing withssh-keygen, run the following command:
The remaining steps are the same as for generating an RSA key. You’ll now have to enter a file location and set a passphrase (if desired), and the system will generate the key with a fingerprint and location.
The key fingerprint you receive is an identifier for your SSH key. You can use it to confirm authenticity when connecting to a remote server. When you generate an SSH key, two keys are generated—a private and a public key. You can distinguish these two keys by their extensions. The private key has no extension, while the public key ends with a.pubextension.
The private key is used for encryption and decryption and should be kept confidential. On the other hand, the public key is only used for encryption, and sharing it with others does not compromise the privacy of the private key.
2. Generating an SSH Key Using WSL
The second method to generate an SSH key is through the Windows Subsystem for Linux (WSL). But why would you choose WSL when you already have the Windows Command Prompt?
WSL provides a complete Linux environment within Windows to run Linux commands without installing a separate OS. This is useful for developers and system administrators working with Windows and Linux.
If you have trouble with this, see ourguide to enabling WSL on Windows.
To start, follow these steps:
Finally, you will see a message with your newly generated SSH key’s location and fingerprint. You can now use this key to secure connections between your computer and remote servers.
What Are the Differences Between RSA and Ed25519 Keys?
In the steps above, we discussed two SSH key types: RSA and Ed25519. But how are they different?
Ultimately, you can use either cryptographic algorithm depending on your systems. Generating SSH keys is easy with the methods available in Windows and should be considered because of serious online risks when accessing remote systems.