logo.png

How to Connect an AWS EC2 Instance in MobaXterm (Ubuntu 26.04)

Saturday, October 03, 2026

Primary Blog/MobaXterm/How to Connect an AWS EC2 Instance in MobaXterm (Ubuntu 26.04)

This tutorial shows you how to connect an AWS EC2 instance in MobaXterm, start to finish. You will create an EC2 instance running Ubuntu 26.04 LTS, set up a secure MobaXterm SSH connection from Windows with a PPK key, and then stop and terminate the instance properly so it does not keep billing you after you are done.

Prefer to watch? The full video walkthrough is below, with chapters for every step.

Get the free step-by-step PDF guide

23 pages, 33 annotated screenshots, 20 steps. Every click from launch to verified cleanup, so you can follow along at your own pace.

What you need

  • An AWS account you can sign in to as an IAM user
  • MobaXterm installed on your Windows PC (the free Home Edition works)
  • About 15 minutes

Step 1: Create an EC2 instance running Ubuntu 26.04

Sign in to the AWS Management Console, open EC2, and click Launch instance. Give the instance a clear name, choose Ubuntu under Quick Start, and confirm Ubuntu Server 26.04 LTS is selected with the 64-bit (x86) architecture. A small instance type such as t2.small (1 vCPU, 2 GiB memory) is plenty for learning. Note the default username for this image, ubuntu; you will need it in MobaXterm.

Step 2: Create a PPK key pair

In the Key pair (login) section, click Create new key pair. Choose RSA and, most importantly, the .ppk file format, which is the PuTTY private key format MobaXterm uses. AWS downloads the file once and will not let you download it again, so move it out of your Downloads folder to a secure, backed-up location.

Step 3: Lock SSH to your own IP

Under Network settings, keep Allow SSH traffic checked and set the source to My IP. Never choose Anywhere (0.0.0.0/0), which opens port 22 to the entire internet. Set storage (32 GiB gp3 is a good default), review the summary, and click Launch instance.

Step 4: Copy the public IPv4 address

In the Instances list, wait until the state shows Running, then copy the Public IPv4 address. Scroll right to confirm the Key name column matches the key pair you just created.

Step 5: Set up the MobaXterm SSH connection

Open MobaXterm and click Session, then SSH. Enter the public IP as the Remote host, ubuntu as the username, and leave the port at 22. On the Advanced SSH settings tab, check Use private key and browse to your .ppk file. Click OK.

You should see the Welcome to Ubuntu 26.04 LTS banner and a command prompt. The SFTP browser on the left lets you drag and drop files between Windows and your EC2 instance. If you see a warning that .Xauthority does not exist on first login, it is harmless; running touch ~/.Xauthority clears it.

Fixing the two most common MobaXterm SSH errors

"Server refused our key" (no supported authentication methods available) means the username or key is wrong. For Ubuntu AMIs the username must be ubuntu, and the private key must match the key name shown on the instance.

"Network error: Connection timed out" means MobaXterm cannot reach the instance. Check that it is running, that you are using its current public IP (it changes after every stop and start), and that the security group still allows SSH from your current IP. If your home IP changed, update the My IP rule.

How to stop an EC2 instance (and what still costs money)

Closing MobaXterm does not stop your server. It keeps running, and billing, until you stop it. Select the instance, open Instance state, and choose Stop instance. Compute charges end, but you keep paying for the instance's EBS storage and any Elastic IP addresses. The automatically assigned public IP is released, so you will get a new one next time you start the instance.

Find forgotten instances with AWS Global View

The EC2 console shows one Region at a time, so instances in other Regions are easy to forget. Click AWS Global View in the EC2 menu to see every instance across all Regions in one list.

How to remove an EC2 instance and stop the billing

When you are finished, choose Instance state, then Terminate (delete) instance. By default the root EBS volume is deleted with it, and termination cannot be undone, so copy off anything you want to keep first. Then confirm nothing billable is left by running these commands in AWS CloudShell, in the same Region as the instance:

aws ec2 describe-instances --instance-ids  \ --query "Reservations[].Instances[].State.Name" aws ec2 describe-volumes --filters Name=status,Values=available \ --query "Volumes[].VolumeId" aws ec2 describe-addresses \ --query "Addresses[].[PublicIp,AllocationId,AssociationId]" aws ec2 describe-snapshots --owner-ids self \ --query "Snapshots[].[SnapshotId,VolumeId,StartTime]" aws ec2 describe-images --owners self --query "Images[].[ImageId,Name]"

The first command should return "terminated" and the rest should return empty lists. Repeat the check in any other Region that Global View showed.

Frequently asked questions

What is the default username for an Ubuntu EC2 instance?

The default username for Ubuntu AMIs is ubuntu, all lowercase. Using ec2-user or root is a common cause of the "Server refused our key" error.

Can MobaXterm use a .pem key instead of .ppk?

MobaXterm works best with the .ppk format, which you can choose when you create the key pair in AWS. If you already have a .pem key, MobaXterm can generally use it as well, but creating a .ppk key avoids conversion steps.

Why did my EC2 public IP address change?

The automatically assigned public IPv4 address is released every time the instance stops. When you start it again, it gets a new address, so update the Remote host in your MobaXterm session.

Does stopping an EC2 instance stop all charges?

No. Stopping ends compute charges, but you still pay for EBS storage and any Elastic IP addresses. To stop all charges, terminate the instance and confirm no volumes, Elastic IPs, snapshots, or custom AMIs remain.

Follow along with the free PDF guide

Keep it open next to the video. The chapters line up with the steps, including the cleanup checklist that keeps surprise AWS bills away.

customer1 png

Hi, I Am Jim

CEO Of Best Blog Ever

One of my favorite quotes is by Zig Ziglar. Zig hit the nail on the head when he said, "You can get everything in life you want if you will just help enough other people get what they want." Your Success is our success.

1 png

Get Our Best Selling Product!

You just read about this...

Super excited about this product? We are, too! We just wrote this whole blog post that mentions it.

Ready to buy it? Get access to the Product here: