Mastering Linux System Administration in DevOps π
π Welcome to Week 2 of the 90 Days of DevOps - 2025 Edition! π
In this exciting journey of mastering DevOps, we are stepping into Linux system administration in Week 2. Linux is the backbone of modern infrastructure, and understanding its administration is crucial for any DevOps engineer. This week, we will cover essential topics that will boost your efficiency in managing Linux-based environments.
π₯ Topics Covered This Week:
1οΈβ£ User Management & Sudo
Managing users and groups efficiently is fundamental in Linux. We will explore:
Creating and managing user accounts (
useradd
,usermod
,userdel
)Understanding permissions and groups (
chown
,chmod
,usermod -aG
)Implementing sudo privileges for security and access control
2οΈβ£ File Permissions & Ownership
Understanding Linux file permissions ensures proper security and access control.
How file permissions work (
rwx
,chown
,chmod
,chgrp
)Setting default permissions using
umask
Managing sudo-based file access for better security
3οΈβ£ Advanced Linux Administration
Diving deeper into essential Linux operations to enhance system management skills.
User & Group Management: Handling user accounts, modifying user permissions, and managing group memberships.
Secure Shell (SSH) Usage & Configuration: Securely accessing remote systems with
ssh
, key-based authentication, and SSH hardening techniques.To connect to an AWS EC2 instance, you need to use an SSH key pair:
ssh -i /path/to/private-key.pem ec2-user@your-instance-ip
Ensure proper permissions for your private key:
chmod 400 /path/to/private-key.pem
To set up SSH access, configure the
~/.ssh/config
file for easier access:Host myserver HostName your-instance-ip User ec2-user IdentityFile /path/to/private-key.pem
Essential Linux Commands:
awk
: Processing and manipulating text data efficiently.grep
: Searching and filtering text from files and logs.sed
: Modifying and transforming text streams.find
: Locating files and directories based on name, size, or modification time.
4οΈβ£ Volume Management & Storage
Understanding disk management is crucial in a DevOps role.
π Introduction to Volumes: Volumes are used to store persistent data. Common types include:
AWS Elastic Block Store (EBS): Persistent storage for cloud instances.
Physical Volumes: Directly mapped to physical hardware.
Logical Volumes: Managed using LVM (Logical Volume Manager).
Volume Groups: A collection of logical volumes to ease storage management.
ποΈ Mounting Volumes in Linux: Attaching storage to a system to make it accessible.
To manually mount a volume:
mount /dev/xvdf /mnt/mydata
To list currently mounted file systems:
df -h
Unmounting a volume:
umount /mnt/mydata
βοΈ Managing AWS EBS on EC2 Instances:
Create and attach an EBS volume via AWS Console or CLI.
Format the new volume:
mkfs -t ext4 /dev/xvdf
Mount it to a directory:
mount /dev/xvdf /mnt/data
π Introduction to LVM (Logical Volume Manager):
LVM allows flexible disk management by creating logical partitions.
To initialize a physical volume:
pvcreate /dev/sdb
Create a volume group:
vgcreate my_vg /dev/sdb
Create a logical volume:
lvcreate -L 10G -n my_lv my_vg
Format and mount the logical volume:
mkfs.ext4 /dev/my_vg/my_lv mount /dev/my_vg/my_lv /mnt/lvmdata
π Using LVM with EBS for Dynamic Storage Management:
Extend an existing logical volume:
lvextend -L +5G /dev/my_vg/my_lv
This allows dynamic storage scaling without downtime.
π Whatβs Next?
At the end of Week 2, youβll have a solid grasp of Linux administration fundamentals. Stay engaged, practice hands-on, and share your progress with the community! π‘
π Follow the #90DaysOfDevOps challenge with #TrainwithSubham and letβs grow together!
π¬ Drop your thoughts and questions in the comments. Letβs discuss and learn!
#DevOps #Linux #90DaysOfDevOps