Linux on AWS: EC2 Essentials for Cloud Engineers
Learn what changes when Linux runs on AWS: connect with SSM, boot with user data, mount EBS volumes, use IMDSv2, and run apps with systemd.
What You'll Learn
Understanding What Changes When Linux Runs in the Cloud
A platform team in Pune gets paged at 2 AM because checkout latency has doubled.
Connecting to EC2 Without Opening Port 22
You need a shell on an instance, but an open SSH port is an invitation.
Bootstrapping Instances with User Data and cloud-init
If setup is manual, every replacement instance starts blank and every fix is lost.
Attaching and Mounting EBS Volumes
Instance storage is not where you keep data you care about.
Reading Instance Metadata with IMDSv2
An instance often needs to know who it is: its ID, Region, and role credentials. It asks a special address that only the instance itself can reach.
Running Apps as systemd Services on EC2
A process started in your SSH session dies when you log out, and it does not come back after a reboot or a replacement.
Skills You'll Master
Curriculum Index8 topics
Understanding What Changes When Linux Runs in the Cloud
A platform team in Pune gets paged at 2 AM because checkout latency has doubled.
Connecting to EC2 Without Opening Port 22
You need a shell on an instance, but an open SSH port is an invitation.
Bootstrapping Instances with User Data and cloud-init
If setup is manual, every replacement instance starts blank and every fix is lost.
Attaching and Mounting EBS Volumes
Instance storage is not where you keep data you care about.
Reading Instance Metadata with IMDSv2
An instance often needs to know who it is: its ID, Region, and role credentials.
Running Apps as systemd Services on EC2
A process started in your SSH session dies when you log out, and it does not come back after a reboot or a replacement.
Building the Hands-On Lab
You will launch an instance with user data, connect with SSM, attach and mount an EBS volume, run an app as a service...
Quick Reference and Common Mistakes
Common mistakes on Linux in the cloud Opening port 22 to the world.
Career Impact
Roles that use the skills in this module.
Cloud Engineer
DevOps Engineer
Solutions Architect
Site Reliability Engineer
Next Modules
Related Guides
Practice on the Coding Sheet
Not a software engineer sheet. Every problem comes from real DevOps, SRE, Platform and Cloud interviews, from your first script to a system you build yourself.
Open the Coding SheetFrequently Asked Questions
Not for everyday access. SSM Session Manager gives you a shell through IAM permissions, with no key pair and no open port 22. Keep a key pair only as a fallback, for example to reach an instance through a bastion host.
Amazon Linux 2023 is AWS's own distribution. It uses dnf, has the default user ec2-user, and ships with the SSM agent and AWS tooling. Ubuntu uses apt and the default user ubuntu. Both work well, so pick one and stay consistent across your fleet.
No. By default user data runs once, at the first boot of the instance. Stopping and starting the instance does not run it again. To test a script again you need a new instance or a cloud-init reset on a throwaway server.
On Nitro-based instance types, EBS volumes appear as NVMe devices, and the name you chose is only a hint. Device order can also change between boots. That is why you mount by filesystem UUID, not by device name.