Linux & Networkingfor DevOps
Engineers
From Shell to Systems
Engr. Akum Blaise
DevOps Engineer, Gozem Africa
2.
Why This Mattersfor DevOps
• Linux and networking form the foundation of
DevOps.
• Cloud platforms, containers, and automation
tools all rely on them.
• Understanding these topics makes you a
better engineer and problem solver.
3.
Lecture Roadmap
• 1.Linux Advanced: Shell scripting, Logging,
Cron
• 2. Networking Basics: IPs, Ports, SSH, DNS
• 3. Advanced Networking: Firewalls, Proxies,
Load Balancers
• All hands-on tasks will be done directly on
your Ubuntu VM.
4.
What is aShell Script?
• A shell script is a text file containing
commands.
• It automates tasks you would normally run
manually.
• Why it matters: DevOps relies on automation
for deployments, backups, and monitoring.
Task: Write YourOwn Script
• Write a script that:
• - Shows CPU, RAM, and disk usage
• - Saves the output into a file called
system_report.txt
• Run the script on your Ubuntu VM.
7.
System Logging
• Logscapture important events.
• Locations: /var/log and journalctl.
• Why important: Troubleshooting crashes,
failed logins, and monitoring system health.
8.
Task: Explore Logs
•On your VM, check logs for:
• - Failed logins (auth.log)
• - Kernel messages (dmesg)
• - System events (journalctl)
• Explain what you found.
9.
Cron Jobs
• Cronautomates recurring tasks.
• Examples: backups, monitoring scripts,
cleanup jobs.
• Why it matters: Automates repetitive work in
DevOps.
10.
Setting up Cron
•Use crontab -e to add jobs.
• Example: */5 * * * * /home/user/myscript.sh
• Runs myscript.sh every 5 minutes.
11.
Task: Cron +Script
• Write a shell script that logs CPU usage to a
file.
• Set up a cron job to run it every 5 minutes.
• Check results in the file after 15 minutes.
12.
IP Addresses
• IPaddresses uniquely identify devices on a
network.
• IPv4: 192.168.1.10 (private)
• IPv6: newer, larger address space.
• In the cloud: servers use private IPs internally
and public IPs externally.
13.
Task: Find YourIP
• Run: ip a
• Find your VM’s private IP.
• Ping google.com to test connectivity.
14.
Ports & Services
•Ports allow multiple services on one machine.
• Examples:
• 22 → SSH
• 80 → HTTP
• 443 → HTTPS
• In DevOps, open ports expose applications to
the internet.
15.
Task: Open Ports
•Run: ss -tuln
• See which services are listening.
• Check how ports change when you start/stop
services.
16.
DNS
• DNS translatesdomain names to IPs.
• Why important: Users don’t remember IPs.
• DevOps: Configure DNS for apps, troubleshoot
issues.
17.
Task: Fake DNSEntry
• Edit /etc/hosts:
• 127.0.0.1 myapp.local
• Ping myapp.local → should resolve to
127.0.0.1.
18.
SSH & SFTP
•SSH: Secure remote login to servers.
• SFTP: Secure file transfer.
• Why important: All DevOps/cloud work is
remote.
• SSH is the entry point to servers.
19.
Task: SSH BetweenVMs
• SSH from one VM to another.
• Create a file remotely to confirm it works.
• Use SFTP to transfer a text file between VMs.
20.
Firewalls
• Firewalls controltraffic into/out of a system.
• Linux tools: ufw, iptables.
• In cloud: firewalls protect servers from
attacks.