How to setup SSH keys using PuTTy Tool- Windows Os?

How to setup SSH keys using PuTTy Tool- Windows Os?

About SSH keys:

Use of SSH keys favors a very boosted form of security against the brute forces attacking a virtual private server. Use of passwords, independent of their complex nature is always vulnerable towards security threats. SSH keys provides a whole new level of security which is safe and impregnable. SSH keys are basically generated in pairs (i.e public key and a private key). One can associate the public key with any server, and only the client in possession of the private key can have access to the decrypted data.

The data gets decrypted only when the two keys  exactly match. This primitive approach of SSH makes it almost impossible to be deciphered by the brute forces. SSH keys also provide an auxiliary security measure, using which a passphrase can be affiliated with the private key which will require the user to enter the passphrase for accessing the private key.

Note: The private key is to be safeguarded and should never be revealed unlike the public key. For setting up the SSH key based security from your windows machine, you will be needing the PuTTy tool for generating the keys. You can download the putty tool from here.

Generate the SSH keys:

Follow the below mentioned steps to generate ssh keys using the PuTTy tool: Step 1: Launch the PuTTygen by opening the exe. file you have downloaded. Step 2: Type of key to generate: Select SSH-2 RSA the key type. Step 3: Number of bits in a generated key: This field requires the bit value of the keys to be generated. Higher the bit value, stronger is the security.Specify either 2048 or 4096 as the bit value. putty1 Step 3: Click the Generate Button. Step 4: Move the mouse pointer randomly within the blank area of the Key section, below the progress bar (to generate some randomness) until the progress bar is full. p3 Step 4: The puttygen should now generate a public key and a private key. Step 5: Key comment: In this field  enter any comment you'd like. This will help you in identifying this key pair, later (e.g. your e-mail address; home; office; etc.) -- the key comment is particularly useful when you generate multiple keys on a same machine. Step 6: Enter a passphrase in the Key passphrase field and enter the same passphrase in the Confirm passphrase field. p4 As mentioned above, a Passphrase is a recommended security measure provided for securing the private key. If the user do not want to opt the passphrase measure, then the user can ignore it by leaving it blank. Use of a passphrase does elevates the level of security. Since the whole concept of SSH is to facilitate security and to safeguard the data from unauthorized accessing. We recommend the use of a passphrase every time you generate the SSH keys. Step 7: Click Save public key, and enter a name for the public key. pub Step 8: Click Save Private key, and enter a name for the same. Private key is not to be shared and hence save it in a very secure location. pri Step 9: Public key for pasting into OpenSSH authorized_keys file: Copy the content present in the Public key for pasting into OpenSSH authorized_keys file on the top. Right click and then click select all and copy the whole content. copy

copy 2

Save the public key on the server:

The next step is to copy the public key to the server you want to secure with SSH based authentication. Step 1: Log in to your server. Step 2: Create a new folder for SSH by using the below mentioned commands:
mkdir ~/.ssh
chmod 0700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0644 ~/.ssh/authorized_keys
Note: Before using the  command for pasting the public key, make sure that you have already installed the Vim Text editor on your cloud. If you haven't, then enter a command based on your server's OS from the below mentioned commands. For CentOs and Fedora:
sudo yum install vim
For Ubuntu and Debian:
sudo apt-get install vim
For Arch Linux:
sudo pacman -S vim
This will install the Vim Text Editor to your server. Step 2: Paste the SSH public key into your ~/.ssh/authorized_keys file by using the following command:
sudo vim ~/.ssh/authorized_keys
Step 3: Tap the I key on your keyboard to enter the Edit mode. Hold Ctrl+Shift+V or use the right click method to paste the private key. Step 4: Save the private key by tapping the below mentioned keys in the given order:

Esc

:

wq

Enter

This will save the private key to your server and this step completes the process of SSH based authentication between your server and your personal computer.
    • Related Articles

    • Creating Tunnel From Windows Using PuTTY

      What is PuTTY? PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers. Please find the ...
    • Set-up SSH keys

      Introduction: Setting up SSH based security to access your server is a much more effective way than the use of a manual root password. Cracking the security system of a VPS depending on SSH keys is nearly impossible since it secures your VPS in a ...
    • How to setup webuzo panel

      If you have created a virtual machine using webuzo panel templates then please refer below steps STEP-1: Please open your server Public IP in browser with using port 2004 e.g : http://205.147.xxx.xxx:2004/ You will get below page where you have to ...
    • How to setup up your DNS records ?

      Introduction: This is an illustrative article, which will walk you through the procedure of setting up your DNS records via e2enetworks platform. DNS (Domain Name System) is a very significant sector of the internet. DNS records must be configured ...
    • Disabling reverse dns lookups in ssh

      Sometimes it is very annoying to wait ten's of seconds to finish remote ssh server's reverse dns lookup procedure. Steps to disable 1. Open configuration file /etc/ssh/sshd_config. 2. Find UseDNS directive and set value to no. 3. In case this ...