top of page

Getting Started with AWS EC2: Connecting to Your Instance with Xshell - A Beginner's Guide

Amazon Elastic Compute Cloud, commonly known as EC2, is a fundamental component of Amazon Web Services (AWS), the cloud-computing platform offered by EC2 enables users to rent virtual computers and utilize them to run their own computer applications on the cloud. AWS offers a plethora of free resources and cloud services, making it an ideal platform for businesses of all sizes.

To get started with EC2, you'll need to sign up here for AWS and set up your account by following the official tutorial. Once you've set up your account, you can follow this tutorial to embark on your EC2 journey.

Connect to your instance using Xshell

1. Open the AWE EC2 consol at

2. In the Launch instance box, click the "Launch instance" if no instance is running, otherwise, click the "Instances (running)" under "Resources".

3. Change Security group settings by clicking the security group ID, and then "Edit inbound rules". This step is important if you want to SSH to EC2 using port 22.

4. Add rule, and then select "SSH" with "Anywhere - IPv4".

5. Import the secret key file ".pem" into Xshell. This file should be generated when setting up your instance in step 1. Open Xshell, tools - User Key Manager - Import, and select the ".pem" file.

6. Follow the steps below to build your connection, where the Host ip is taken from the "Public IPv4 address" as shown below, and the default "User Name" is:

  • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.

  • For a CentOS AMI, the user name is centos or ec2-user.

  • For a Debian AMI, the user name is admin.

  • For a Fedora AMI, the user name is fedora or ec2-user.

  • For a RHEL AMI, the user name is ec2-user or root.

  • For a SUSE AMI, the user name is ec2-user or root.

  • For an Ubuntu AMI, the user name is ubuntu.

  • For an Oracle AMI, the user name is ec2-user.

  • For a Bitnami AMI, the user name is bitnami.

  • Otherwise, check with the AMI provider.

7. Connect to EC2, and use cat /proc/cpuinfo and du- H to check the CPU and storage information.


If you found this tutorial helpful, consider joining our community by making a donation. Your support will enable me to continue creating valuable content while also supporting my baby's care. Together, we can make a meaningful impact. Thank you!


bottom of page