Share on Social Media

In this Linux tutorial, you will learn, how to setup SSH Keys in PuTTY. #centlinux #linux #ssh

Problem Statement:

PuTTY is a free and open-source SSH and telnet client. It is primarily developed by Simon Tatham for Microsoft Windows but now it supports a wide variety of other operating systems. Public key authentication is a feature of PuTTY, in which, we can configure SSH Keys to allow password less logins to Linux machines from our PuTTY terminals.

In this article, we will setup SSH Keys in PuTTY by using PuTTYgen and then configure a CentOS 7 machine for password less logins by SSH client.

Environment Specification:

One Microsoft Windows based client and a CentOS 7 based server.

Generate SSH Keys using PuTTYgen:

PuTTYgen is included with PuTTY SSH client. Both are free and open source and distributed under MIT License. Therefore, it is available for free download at PuTTY official website.

We have already installed PuTTY SSH client on our MS Windows client.

Search and run PuTTYgen application.


Click on Generate button to generate a SSH Public/Private keys pair.


Meanwhile, we are required to scroll mouse in the area under the progress bar for randomization and generation of SSH Keys.

ssh key

PuTTYgen has generated a SSH Public/Private keys pair.

Click on Save private key button to save the SSH Private Key locally.

ssh keyconfirmation

Since, we are not defining any passphrase, therefore, PuTTYgen is displaying the above warning.

Ignore it and click on Yes.


We have saved our SSH Private Key in a local directory. You can also save your SSH Public Key in the same way, if you plan to use this same SSH Keys pair for more than one Linux machines.


Select the generated SSH Public Key and copy it to clipboard.

Setup SSH Keys in PuTTY:

Connect to our CentOS 7 machine using PuTTY and insert SSH Public Key in ~/.ssh/authorized_keys file.

login as: root
root@'s password:
Last login: Tue Jan  1 18:58:53 2019 from
# mkdir ~/.ssh
# vi ~/.ssh/authorized_keys
# exit

Now, open PuTTY and add a session for that CentOS 7 server.


Besides other settings, we are required to include our SSH Private Key as follows:


Save first and then open this session.

login as: root
Authenticating with public key "rsa-key-20190101"
Last login: Tue Jan  1 18:59:44 2019 from

Our CentOS 7 server won’t prompt for a password this time.


In this tutorial, you have learned, how to setup SSH Keys in PuTTY by using PuTTYgen for password less logins to Linux machines.