Day 10 โ€“ Provisioning and Connecting to an EC2 Ubuntu Instance on AWS (Level 1)

AkankshaAkanksha
2 min read

As part of my journey into AWS and DevOps, todayโ€™s task was to launch an EC2 Ubuntu instance and connect to it securely using SSH. This is a basic but critical building block for deploying cloud-native systems, running automation scripts, or hosting services.


โœ… Objective

  • Provision a virtual machine using EC2

  • Configure networking and key pair for secure access

  • Connect via SSH

  • Identify and resolve real-world issues during setup


๐Ÿงฑ Step-by-Step: EC2 Instance Launch

From the AWS Management Console:

  • AMI: Ubuntu Server 24.04 LTS (HVM)

  • Instance type: t2.micro (Free tier eligible)

  • Key Pair: Created new key ubuntuServer-1.pem

  • Security Group: Opened port 22 (SSH) for my IP

  • Storage: Default 8 GB

Launched the instance and verified that it moved into the โ€œRunningโ€ state.

Instance Running


๐Ÿ” SSH Connection Steps

AWS provides a one-click SSH instruction under the Connect tab. I followed these instructions:

chmod 400 ubuntuServer-1.pem
ssh -i "ubuntuServer-1.pem" ubuntu@ec2-15-207-177-77.ap-south-1.compute.amazonaws.com

Connection Instructions


โš ๏ธ Issue Faced: SSH Connection Timeout

Initially, I faced an error:

ssh: connect to host ec2-15-207-177-77.ap-south-1.compute.amazonaws.com port 22: Connection timed out

๐Ÿ” Troubleshooting Process:

  • โœ… Verified security group had SSH (port 22) open to my IP โ€” confirmed โœ”

  • โœ… Checked key permissions using chmod 400 โ€” confirmed โœ”

  • โœ… Validated Public IP in EC2 details โ€” matched โœ”

  • โŒ Issue: My local firewall had outbound connections blocked on port 22.

๐Ÿ› ๏ธ Fix:

  • Temporarily disabled firewall to test.

  • Once confirmed, added a firewall rule to allow outbound SSH (port 22) connections.

  • Re-ran the SSH command and successfully connected.


๐Ÿ–ฅ๏ธ Logged Into Ubuntu Server

Once connected, I verified:

  • OS version: Ubuntu 24.04.2 LTS

  • System metrics: CPU, memory, and load

  • Network: Confirmed private IP, public IP, and hostname

๐Ÿ“ธ SSH Terminal


๐Ÿง  Key Takeaways

  • SSH troubleshooting is a practical skill โ€” cloud engineers often deal with networking/firewall misconfigurations.

  • Default security group and firewall configurations must be reviewed thoroughly.

  • AWSโ€™s connection tab offers reliable guidance if used carefully.

  • Always verify:

    • Security Group rules

    • Key permissions

    • Correct user (ubuntu for Ubuntu AMIs)

    • Public DNS/IP match


๐Ÿ”ญ Engineering isn't about never facing problems. It's about recognizing, debugging, and solving them with precision and calm. Today was exactly that โ€” a small problem, a real fix, and a deeper understanding.

0
Subscribe to my newsletter

Read articles from Akanksha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Akanksha
Akanksha