How to connect to my server with SSH key (public/private key pairs) and using PuTTY?

In order to connect to your server using public key authentication method, you need two things:
1. A public/private key pair
2. An SSH client software

We will use the server portal for generating and managing public/private key pair(s) and for the SSH client software, we will use PuTTY.

1. In server panel, go to the SSH Keys tab and click on Add Key button to add/generate a new key pairs.
ssh_pubkey_putty-01.png

2. Click on the Generate Key Pair button.
ssh_pubkey_putty-02.png

3. In the Name field, enter a desired name for the key. You can leave Key Type and Key Size choices the defaults too.
In the Private Key Format section, choose PuTTY if you want to use that software and finally click on the Generate button.

Note: Do not choose OpenSSH for the Private Key Format if you want to use PuTTY because PuTTY doesn't support that format.
ssh_pubkey_putty-03.png

4. After a couple of seconds, a pair of public and private keys will be generated that you can use.

Note: As it is stated in the dialog too, you must save the private key to a safe place because after closing that dialog, it cannot be shown to you.

Copy the content of the private key field to your clipboard and finally click on the Save button.
ssh_pubkey_putty-04.png

5. Open Notepad (or any other text editor) and save the private key that you have copied from the previous step in a file for later usage in PuTTY.
ssh_pubkey_putty-05.png

6. Now that SSH key has been added to the server panel, you can select it during the Rebuild process. Public key will be automatically injected into the OS that you have chosen and can be used for authentication.
ssh_pubkey_putty-06.png

7. Open PuTTY and enter IPv4 (or IPv6), default SSH port (22), SSH as the connection type and from the left pane, click on the Credentials section under Connection -> SSH -> Auth
ssh_pubkey_putty-07.png

8. In the Private key filed of Credentials window, Click on Browse button and select the private key that you have saved in step 5 and finally click on Open in PuTTY.
ssh_pubkey_putty-08.png
ssh_pubkey_putty-09.png

9. If it's the first time that you are connecting to your server, an alert will be shown to you. Click on Accept button to proceed.
ssh_pubkey_putty-10.png

10. You will be asked to enter the name of the user that you want to authenticate as; type root and press Enter key.
ssh_pubkey_putty-11.png

11. If all is done properly, you will be connected to your server.
ssh_pubkey_putty-12-2.png


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 45