A secure connection is a requirement for any connection that uses a public data network. One technique that implements a secure session is the SSH (Secure Shell) protocol. In this tutorial, I will teach how to connect to a Linux EC2 instance using SSH from a Windows client. Mac, Linux and Unix users have SSH built into a terminal shell like BASH, but Windows does not have it by default. You can use OpenSSH with Windows PowerShell but another technique is to use the Putty client for Windows (Version 7 and Higher).
Step 1: Download and install the Putty client.
You can get the client application from the following link:
PuTTY: a free SSH and Telnet client
Note: Verify the link, as it may be subject to change.
It is free of charge. Make sure you download the latest version. Follow the instructions (install the entire suite) when running the setup. If you are using Windows 7 and higher, use the 64-bit version of the software.
Step 2: Prepare your PEM Key File from the EC2 instance.
When setting up your EC2 from the AWS cloud, you will be able to create or use an existing key. It can be downloaded as a PEM (Privacy Enhanced Mail) file. This is the digital certificate generated for connecting to the EC2 instance using the SSH protocol. You can give the key a custom name.
EX: mySSHkey.pem
You can also use an existing PEM file, but you must specify that in the EC2 configuration during setup. (Refer to AWS EC2 instance installation for more info)
Step 3: Convert PEM file to PPK file using PuttyGen

Putty comes with a utility called PuttyGen. What PuttyGen does is convert the PEM file to a PPK, the format used for Putty SSH connections.
Go to → Start menu → choose All Programs → PuTTY → PuTTYgen.
If you get a dialogue asking if you want to run the utility, click Run.
In the section ‘Type of key to generate’, choose RSA. For older versions, choose SSH-2 RSA.
Step 4: Load Private Key to create PPK file

Next, click Load under the section ‘Load an existing private key file’. Once the dialogue box comes up, at the bottom make sure you select ‘All Files’ dropdown list.
Select the location (folder or directory) where you saved the .PEM file. A PuttyGen notice dialogue will appear saying it was successfully imported. Click OK to close this dialogue.
Now go to File → Save private key. You have the option to use a passphrase. If not, then just click Yes. Give your key a name and then Save.
The .PPK file will now to be created and saved to the location of your .PEM file.
Step 5: Open Putty to configure connection to EC2 Linux instance
Open Putty
Start menu → All Programs → PuTTY → PuTTY
Step 6: Configure the Putty connection
Under the Category section, you will see options that are expandable nodes (tree structure).
Select Session.
You should see a field called Host Name.
Use this format as the parameter:
user_name@public_dns_name or
user_name@ip_address (if no resolvable DNS name is set)
Make sure the port is set to 22 (default) for SSH (though you may want to check on your server in case the admin may have changed the port for some reason. SSH uses port 22 by default).
The default user_name is ec2-user
Here is a list of default user names:
For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
For a CentOS AMI, the user name is centos.
For a Debian AMI, the user name is admin or root.
For a Fedora AMI, the user name is ec2-user or fedora.
For a RHEL AMI, the user name is ec2-user or root.
For a SUSE AMI, the user name is ec2-user or root.
For an Ubuntu AMI, the user name is ubuntu.
Finally, select SSH for connection type.
Step 7: Configure your private key (PPK file)
Under the Category section, you will see options that are expandable nodes (tree structure).
Select Connection → SSH → Auth
You will see the field ‘Private key file for authentication’
Click Browse, then locate your PPK file folder or directory.
Step 8: Connect to the EC2 instance

Click Open and you should connect to the EC2 instance.
You can then save your session so that you do not have to recreate it the next time you want to connect.
Just go to Category → Session → Now enter a name for the session in Saved Sessions, then choose Save.