Often, instead of the standard username and password, you would like to use a private SSH [ How to connect to server using PuTTY ] key to connect to remote host via SSH. In this short post, I will show you how to connect to your server instance using SSH key and PuTTY on Windows.
First, at the session window, enter your host name or IP address and select SSH as Connection type.
If you want, you can save your session – enter you session name at the Saved Session field and click Save. Without it, you will have to enter your configuration details every time.
Add Private Key File
Next, download your key to your local computer and go to Connection -> SSH ->Auth at the category tab. You should see Private key file for authentication like on the screen below:
How To Connect To Linux Server From Windows Using PuTTY?
Click Browse… and select private key file from your computer.
Next, go to session tab and click Save to remember you private key file location and that’s it!
Finally, click Open button to connect to server. That’s all about how to connect to server using PuTTY!
Putty Key Generator
To generate private and public keys using Putty Key Generator you need to open PuTTYGen which was installed with PuTTY. Search for it in the start menu by typing: PuTTYGen. Then you have to select the Key Type to Generate like:
- SSH-1 (RSA)
In our case we will choose the first one – RSA. Then click Generate button and you will have to move your mouse to get input for Putty Key Generator. This is such a trick, because no one will be able to repeat the moves you made, so the probability of generating the same two pairs of keys is practically equal to 0.
After generating the key, save the private and public key on your hard drive. For security, you can assign a password to the private key. When you give a password, then each time you try to use this key during the connection, you will be asked for the password, which gives you another layer of security. I come here when someone could steal your private key file, it will be a problem because you will also need to know the password.
After reviewing this post, you should be able to connect to any server with a private-public key pair using SSH. In addition, we learned how to generate a private and public key when we do not have them yet.
If you enjoyed this post please add the comment below and share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!