SSH Keys are essential for authentication if you require connecting to the remote servers, Github, etc. In this article, I will be sharing what is SSH Key usually used for and what are the easy ways to generate SSH keys if you are using Windows OS like Windows 10, 11, or server OS.


What Is SSH Key Used For?

SSH stands for Secure Shell, which is the protocol commonly used to authenticate and establish over to a remote server via secured encrypted communication.

An SSH key pair consists of two files: one private and one public. When you connect to a remote server via SSH, it uses the public file to authenticate yourself. The private file is used to encrypt your connection, which means only you can decrypt it.


What Are The Ways To Generate SSH keys in Windows Machine?

Personally, I feel these are the easiest ways to generate SSH Keys in just a few easy steps

1. Using Command Prompt

If you are running on Windows 10 or above, you can simply use the ssh-keygen command prompt

ssh-keygen

after you enter the command, it will prompt you to enter the name for this file to save into the directory.

ssh-keygen in command prompt

It is optional whether you want to enter the passphrase, you can leave it blank if prefer without any passphrase. It is recommended to have a passphrase to act as an additional layer of security.

ssh-keygen in cmd passphrase

As I did not define any path earlier when entering the file name to save the key therefore it actually saved into my profile folder C:\user\username

Using PuttyGen to Generate

Another way is to use PuttyGen which is one of the tools in Putty. In fact, Putty is one of the most commonly used tools and you can get Putty Key Generator from Putty’s website directly.

You can refer to the screenshot below for the PuttyGen Interface. In the Parameter section, you can type of keys and the number of bits. If everything is ok, you can simply click on the Generate button

using puttygen to generate ssh key

Once the SSH Key is generated, you can click on the Save Publick Key button to save the public key.

As for the private key, there are different ways to save it as it depends on your requirement.

  1. Click on the Save Private Key button to save *.ppk format to use it for Putty
  2. Else you can select Conversions at the top menu -> Export OpenSSH Key

Final Thoughts

Hopefully, it give you a brief idea of what is SSH Keys for and 2 easy ways to generate SSH Keys with just a few clicks or commands.

If you have other ways to generate SSH Keys feel free to comment and let me know too!