Linux Administration, AWS AMI, and Shell Scripting Basics for Beginners ๐

Linux and AWS are among the most important technologies in the DevOps world. Understanding concepts like Amazon Machine Images (AMI), EBS Volumes, Nginx deployment, and Shell Scripting can help beginners build a strong foundation in Linux Administration and Cloud Computing.
In this article, we'll explore these concepts step by step with practical examples.
๐ What is AMI (Amazon Machine Image)?
An Amazon Machine Image (AMI) is a pre-configured template that contains:
Operating System
Application Server
Installed Software
Configurations
AMI allows us to create multiple EC2 instances with the same configuration whenever required.
Why Use AMI?
Faster server deployment
Backup of configured instances
Easy scaling
Consistent environments
๐ Creating an AMI from an EC2 Instance
Suppose you have already launched an EC2 instance and deployed a website.
Step 1: Launch an EC2 Instance
Create an EC2 instance using Ubuntu or Amazon Linux.
Step 2: Attach an EBS Volume
Attach a 20GB EBS Volume to the instance.
Verify attached storage:
Check mounted filesystems:
Step 3: Install Nginx
Update packages:
Install Nginx:
Check Nginx status:
Enable Nginx:
Step 4: Deploy a Web Page
Navigate to:
Create or modify:
Add sample HTML content and save.
Step 5: Configure Security Group
Allow HTTP traffic.
Inbound Rule
| Type | Port | Source |
|---|---|---|
| HTTP | 80 | Anywhere (0.0.0.0/0) |
Save the rules.
Step 6: Verify Website
Copy the Public IP of the EC2 instance.
Open browser:
You should see the Nginx webpage.
๐ผ๏ธ Creating an AMI
After configuring the server:
Steps:
Select EC2 Instance
Click Actions
Select Image and Templates
Click Create Image
Enter Image Name
Add additional volume if required
Click Create Image

AWS will take some time to generate the AMI.
๐ Launching a New Instance from AMI
1.Open AMIs
2.Select your created AMI
3.Click Launch Instance
4.Choose Key Pair
5.Configure instance details
6.Launch
The new instance will have:
Nginx installed
Website deployed
Attached configurations preserved
This is useful for backup and scaling purposes.
๐ Introduction to Shell Scripting
Shell scripting automates repetitive Linux tasks.
A shell script is a text file containing Linux commands.
Create Script
Edit:
Structure of a Shell Script
Give Execute Permission
Run:
๐ค Creating a User Using Shell Script
๐ Creating Files and Folders Using User Input
Folder Creation
๐ Creating Folder and Assigning Permissions
Permission Meaning
| Value | Permission |
|---|---|
| 7 | Read + Write + Execute |
| 6 | Read + Write |
| 5 | Read + Execute |
| 4 | Read Only |
๐ Conditional Statements in Shell Scripting
Conditional statements allow decision-making.
Example
๐ Grade Calculator Using If-Else
Sample Output
โ๏ธ Using Functions in Shell Script
Functions improve code reusability.
Example
๐ฏ Conclusion
Learning Linux Administration and AWS basics is a great starting point for a DevOps career. In this article, we covered:
โ AMI Creation and Usage โ EBS Volume Attachment and Mounting โ Unmounting Volumes Safely โ Nginx Installation and Deployment โ Security Group Configuration โ Shell Scripting Basics โ User Creation Automation โ File and Folder Management โ Conditional Statements โ Functions in Shell Scripts
Mastering these fundamentals will help you automate tasks, manage cloud infrastructure, and build scalable environments efficiently.
Happy Learning! ๐๐งโ๏ธ



