Install the putty tools
sudo apt-get install putty-tools
Generate the pem file run the following command as-
puttygen ppkkey.ppk -O private-openssh -o pemkey.pem
Place the pemkey.pem file in your ~/.ssh directory as-
cp pemkey.pem ~/.ssh
Set the pem file to have the proper permissions as-
chmod 400 pemkey.pem
Now, we have a valid pem file that we can use to connect to our EC2 instances from Linux.
Now Connect to your pem by this command
ssh -i pemkey.pem user@ec2-instancedotcom
Similarly, if we want to convert pem file to ppk, we can do it like this
puttygen pemKey.pem -o ppkKey.ppk -O private
#Flags:
-o Tells it where to write out the converted putty private key
-O private Tells it that you want a putty private key.