Use pem file in MobaXterm to connect ec2 machine in AWS

Tzung-Chien Hsieh
2 min readSep 29, 2021

--

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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tzung-Chien Hsieh
Tzung-Chien Hsieh

Written by Tzung-Chien Hsieh

PhD in Computer Science, I will share what I learned in Programming, Machine Learning, and Rare Disorders.

Responses (1)

Write a response