Use pem file in MobaXterm to connect ec2 machine in AWS
In this article, I will introduce how to use the pem file in MobaXterm to connect the ec2 machine in AWS, and how I solve the issue I encountered when I use the pem file generated by AWS for the private key.
First of all, go to the session settings to create a new session. Select SSH tab and “Advance SSH settings”. You will find the checkbox of “Use private key”, and select your private key. In theory, we are done after we fill up the remote host and username. However, I find out I cannot connect to the machine. If you encounter the same issue, please go to the next part below.

Originally, I don’t what happened to the pem file. I can use the same file to connect to ec2 by console or x2go without any problem. In the end, I find out that it doesn’t work only when there is a passphrase in the pem file.
Therefore, I simply solve it by removing the passphrase by openssl.
openssl rsa -in my.pem -out my.key
I am not sure whether it is the bug in MobaXterm or I didn’t create my pem file correctly.
Therefore, it is only the workaround to solve this issue. I am still searching for the correct way to solve it properly.