Generate an SSH Key in Linux and Windows in 2021

Use Putty to create SSH Public and Private Keys!

Putty Key
Created by Putty Key Oct 1, 2021

SSH is a secure network protocol commonly used to log in to the remote server and execute commands. It uses client-server mode.

For generating SSH keys, the user requires a third-party key generator. You must Download PuttyKey. It is a key generator tool that supports all network protocols.

SSH is typically used to log into a remote machine and execute commands, but it also supports tunneling, forwarding TCP ports. It can transfer files using the associated SSH file transfer or security protocols.

How to Generate an SSH Key?

You can generate the key pair on any system, but you require to copy the private key to any instances that will be used to connect to the HSM appliance.

If you generate the key pair on the same instance that you will use to connect to the HSM appliance, you don't have to copy the private key file. You can use an actual SSH key pair or generate a new one.

There are many key pair generators available, but in Linux, a common generator is an ssh-key generator command. In Windows, you can use the PuTTY Keygenerator utility.

Generating an SSH Key in Linux

To generate an SSH key on a Linux system, you can use the ssh-keygen command as shown in the following example -

Generating an SSH Key in Windows

To generate an SSH key on a Windows system, you can manage the PuTTY Key Generator utility. For more information about using the PuTTY Key Generator utility to create a key pair.

PuTTY stores its private keys in an established format that is only used by PuTTY. If you need to use the private key with an SSH client other than PuTTY.

You can use PuTTY Key Generator to convert the private key to OpenSSH format by clicking on Conversion in the PuTTY menu and selecting the Export OpenSSH key.

The public key that is managed by the HSM appliance must be in SSH format. In PuTTY, copy the contents of the Public key for repairing into the OpenSSH authorized keys file field and save this to a file. This is your public key file.

Copy the Private Key to a Windows Instance

Perform the following steps if your check instance is a Windows instance.

  • Copy the private key file from the system it was saved onto the directory on the control instance where your PuTTY keys are stored.

  • Connect to the control instance over RDP. The remaining steps in this system are performed from the control instance.

  • If the private key is not a PuTTY private key file, perform the following steps -

  1. In the control instance, use PuTTY to introduce the private key file that was followed by clicking on Conversion in the PuTTY menu, choosing Import key, and selecting the private key file. You are proposed for the passphrase for the key.
  2. In PuTTYKey, save the private key as a PuTTY private key file by selecting Save private key.

  • When you correlate to the HSM appliance using PuTTY, you use this private key file for authentication. To stop you from having to enter your passphrase every time you log in, you can use Pageant.

  • The show is an SSH authentication agent that is used with PuTTY. It holds your private keys in memory, previously decoded so that you can use them regularly without requiring to type a passphrase.

How to Generate SSH Key

Final Words

Using this article, you can generate SSH public and private keys. Use Putty and Generate SSH Keys. Thank you for reading this article.