Convert AWS .ppk key to .pem openSSH

I had to deal recently with AWS instance, and I was provided only with .ppk key, which is not not exaclty compatible with openSSH.
You can use PuTTY under Linux, but this thing looks really awful, if you think I am being pretentious just take a look at this garbage:

So what you need to do is to use

puttygen

which comes with PuTTY.

You will have to install with your package manager PuTTY, it should be available in yout repos, as it is fairly popular package.

I am using Ubuntu so for me that would be:

sudo apt-get install putty

Navigate to the folder where your .ppk key is and generate .pem key:

puttygen aws.ppk -O private-openssh -o aws.pem

Move it to your .ssh filder where all the other keys are and change key permissions:

sudo chown 400 .ssh/aws.pem 

And then connect specifying that you want to use your with the -i option:

ssh -i .ssh/aws.pem ubuntu@ec2-21-000-12-37.compute-1.amazonaws.com

Just be careful about the key path, and typos and it should be fine.