This document explains the procedure to generate the SSH key pair in Linux and Windows environment.
Icon | Meaning | Description |
---|---|---|
Note | Provides information good to know | |
Caution | Indicates situation that might result in loss of data or hardware damage |
An SSH key is an access credential in the SSH protocol. Its function is similar to usernames and passwords, but the keys are primarily used for automated processes and for implementing single sign-on by system administrators and power users. SSH keys enable the automation that makes modern cloud services and other computer-dependent services possible and cost-effective. They offer convenient and improved security when properly managed. SSH keys are a matching set of cryptographic keys which can be used for authentication. Each set contains a public and a private key. The public key can be shared freely without concern, while the private key must be vigilantly guarded and never exposed to anyone.
Follow the steps below to generate an SSH Key in Linux command shell:
Figure 2-1: Linux Terminal Screen
Before adding a new SSH key to the ssh-agent to manage the keys, user should check for existing SSH keys and generate a new SSH key. Start the ssh-agent in the background
Once the ssh-agent is running, the following command will add the new SSH key to the local SSH agent
The new SSH key is now registered and ready to use.
This section explains the steps to generate an SSH Key in windows with OpenSSH client.
Figure 3.1-1: Windows Apps and Features
Figure 3.1-2: Windows Optional Features
Figure 3.1-3: Windows Command Prompt as an Admin user
Figure 3.1-4: Command Prompt in Windows
Figure 3.1-5: Command Prompt with Generated SSH Key
The PuTTY tool was the golden standard for generating SSH keys before OpenSSH in Windows
Figure 3.2-1: PuTTY Installation Page
Figure 3.2-2: PuTTY Product Selection Page
The process outlined below will generate RSA keys, a classic and widely used type of encryption algorithm. The PuTTY Keygen tool offers several other algorithms – DSA, ECDSA, Ed25519 and SSH-1 (RSA).
If the user requires a different encryption algorithm, select the desired option under the Parameters heading before generating the key pair:
Figure 3.2-3: PuTTY Key Generator
Figure 3.2-4: PuTTY Key Generator
The SSH agent must be run in the background to add SSH key.
To run SSH agent follow the below methods:
Figure 3.3-1: OpenSSH Authentication Agent
Figure 3.3-2: OpenSSH Authentication Agent Screen
On successfully running the SSH agent in the background the user needs to follow these procedures to add the generated SSH key.
Enter the below command: