Though it is always possible to login in your server using username and password, but you always remain vulnerable to brute force attack. You will always feel that someone may break your password and get privileged access to your server. Are there any better ways to make your server access more secure? The answer is positive. You can make your server access more secure by generating SSH key pair.
What are SSH keys?
The main idea behind SSH key based log is that you will have two keys: private key and public key. A private key must be kept secret and should be kept in the computer that you will use for remote logon purpose. The public is shared with the host or the server that you want to connect to. There is no problem in sharing public key with other. When a server has your public key you can access that server remotely from your computer if your computer has the private key stored in it. The unique combination of the public and private key allows access to the server. Remember that public and private keys are generated in pairs and that pairing is unique. Therefore, only when the public key will see your private key it will allow you to use the server. You do not need to remember any password. If you want to remember anything like password you can create a memorable passphrase when you generate your keys. Paraphrase is not mandatory, but it adds an extra security to your keys.
Note: even if someone has your paraphrase they cannot access your server unless they have your private key. So, always pay attention to the secrecy of the private key.
|SSH key generation process:To generate keys you need to remember the following steps:At first generate public and private keys using PuTTYkeygenSave the public and private key in your computer.
Upload the public key to the remote server that you want to access remotely.
Finally, access the server using Putty.
Steps 1: generate keys
Download putty-0.64-installer.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and install it in your computer. Next, go to your all program click on Run PuTTYgen and then click on “generate” button and hover your mouse in the empty space as shown in the screenshot below:
By hovering mouse in the empty space in the PuTTY key generator, you generate some random data for creating a unique key pair, which will not be reproducible by anyone else because of the randomness of your mouse waving.
Once key generation completes, you can write your passphrase in the keyphrase box if you want to. Your key phrase can be anything such as “mykeysareblue” or anything that you can easily remember. If you do not want to use keyphrase then just click on save private key and save public key. Otherwise, type your keyphrase and save both the keys. Before saving the public key, you can copy the public key from the key generator and paste in a text file. Later you need to upload or paste this public key in the remote server.
Step two: connect to the server with PuTTY
Next, open putty and click on connection. Next click on Auth under SSH.Then locate the private key file suing browse option. Finally click on open to start the connection. Type the user name and passphrase.
Most of the cloud server gives an easy option in their user interface to past the public key. If you are not sure about how to put the public key in your server, you contact your host for help.