How to Generate SSH Key on Windows Server and Client?

In this article you will learn how to generate SSH keys on windows server and client using Windows PowerShell and PuTTYgen application.
5 min read
Beginner
Generate SSH Key on Windows Server and Client

To securely connect to a server, git repositories, or other remote services from your Windows device, or connect to another Windows device, you need to create SSH keys to connect without a password by using key authentication instead of user credentials.

In this article, you will learn how you can create SSH private and public keys on Windows Server and Windows 10 / 11.

There are many methods to create SSH keys on Windows: one with PowerShell and one with the PuTTYGen application.

Check SSH on Windows Server and Client

Open your computer or, if you are using it remotely, connect to your Windows to start the process.

In most of the modern Windows devices, OpenSSH is installed by default, which is needed to use an SSH connection and key generation. But you can verify it from Windows PowerShell by following the steps below:

1- Press the Windows button on your keyboard or click on the Start menu button and search for PowerShell and run it as Administrator.

2- You can verify it by checking its version or connecting to another Linux Server using SSH.

BASH
ssh -V

If you see an error like “ssh is not recognized as an internal or external command”, it means OpenSSH is not installed or not properly enabled on your system.

ssh key not recognized as an internal or external command error in windows

Generate SSH key in Windows PowerShell

Using Windows PowerShell, you can generate SSH key pairs (public and private) both on Windows Server and on Windows Client.

Run PowerShell as Administrator

Click on the Start menu or press the Windows key on your keyboard and search for PowerShell. Then run it as Administrator.

search and open powershell in windows

Generate SSH Key Using SSH Keygen in Windows

To create SSH key pairs, you need to use the ssh-keygen command in Windows PowerShell. SSH keys have many types that you can choose from, but the most used and modern standard is ed25519 that we will use in the following steps.

Run the commands below to create the SSH key on your Windows:

Create SSH Keys With ed25519 Type in Windows PowerShell:

BASH
ssh-keygen

Also, you can create a key with older compatible types using this command:

BASH
ssh-keygen -t rsa -b 4096

Specify SSH Key Path in Windows PowerShell

You will be asked to specify a location where the keys will be saved. You can choose a custom path if you want, or simply press Enter to accept the default location and continue.

specify location to save the ssh keys on windows

In this image, it shows that you are creating two keys: a public and a private key with the ed25519 type, which is the default type, and it shows the default location where it will store the files.

Set SSH Key Passphrase Windows

In this step, you will be asked to specify a password for your keys. If you want, you can press Enter to leave it empty. But it is recommended to set a password for better security.

Setting password for ssh keys in windows

Check SSH Key in Windows PowerShell

ssh key creation with powershell in windows

After setting the password for your keys, you will see your SSH key fingerprint and the locations where the files are saved. You can go to these locations on your computer and check whether the files have been created.

You will see two files: your public key and your private key:

ssh key files on windows

Your public key can be shared, but don’t share your private key.

Generate SSH Key With PuTTY in Windows

To create an SSH key in a Windows environment, you can use PuTTY software, which is designed to communicate with servers in Windows. PuTTY comes with several helper programs, one of which is PuTTY Key Generator, which is used to generate keys. Here you can download Putty.

Run PuTTYgen on Windows

Click on the Start menu or press the Windows key on your keyboard and search for “PuTTYgen“. You can use Putty to connect to every server that allows connection with the SSH protocol, such as MikroTik VPS Server or Linux VPS server.

search for your puttygen application on your windows

If you don’t know how to use PuTTY to connect to servers, you can learn by following this article:

How to Connect to Linux Server From Windows Using SSH?
READ How to Connect to Linux Server From Windows Using SSH?

Select Key Type in PuTTYgen Windows

Using PuTTYgen, you can create SSH keys with multiple types supported by SSH keys, but it’s recommended to use the most commonly used ones like ed25519 or RSA.

1- Select the EdDSA key type > then select Ed25519 type > Click on Generate.

select the SSH key type in putty application

2- You will be asked to move your mouse randomly on the screen to create a random pattern for your SSH key to make it more secure. Move the mouse randomly till the progress bar ends.

Mouse random move in PuttyGen application to create random pattern for key

3- Specify a password for your SSH keys and save both the public and private key files in the location you want.

specify password for ssh keys in putty and save them

Now that you have your keys generated, you can use them to connect to your servers.

Note:
If you face connection issues, it may be from blocked ports on your Windows firewall. You can fix it by opening port in Windows.

Connect to Linux Server Using SSH Keys

To connect to a Linux Server with SSH Key or other servers that support the SSH protocol from Windows, you can use the PuTTY application itself, or you need to copy your public key content to the destination server and add it to authorized_keys to accept your connection from Windows by key.

To connect to your Linux server, you need to create SSH key on your Linux server too to use SSH key authentication instead of user authentication.

Conclusion

In this article, we walked through how you can create SSH key on your Windows using the PuTTY application or the ssh-keygen command.

Now you are all done with creating SSH key on your Windows side. just need to copy your SSH public key to your Linux server and add it to the authorized keys to accept connections with your key.

Hope this article helped you to establish secure connection to your server!

Share:

Was this article helpful?

Your feedback helps us improve our technical guides.

Related Posts

You May Also Like

Explore more tutorials, guides, or documentation, from VPSMakers.

Learn how to install PHP on Windows Server, configure IIS with FastCGI, install PHP Manager, and test your PHP setup.
Richard Mourar
November 5, 2026
Learn IIS installation on Windows Server using Server Manager and PowerShell. In this guide you can learn how to install, and verify it.
Robert Smith
November 4, 2026
There are multiple ways to open a port Linux, depending on the distribution you're using. In this guide, we cover the most practical methods.
Richard Mourar
November 3, 2026
Enabling RDP on Windows Server invloves multiple methods, we've covered enabling with PowerShell, CMD, Server Manager, and Windows Settings.
Jacob Rafet
November 2, 2026