Module 1 — Linux Systems Administration
Goal: LPIC-1-equivalent working knowledge, learned entirely by doing on lab-box. By the end you can navigate, edit, manage users/permissions/processes/services/ packages/disks/logs, and write a small shell script — the daily bread of every cloud engineer.
All labs run on lab-box over SSH. Type everything.
1.1 The shell: your new dial tone
Theory (10 min): kernel vs shell vs terminal; why servers have no GUI; the prompt
anatomy user@host:dir$.
Lab 1.1 — Finding your way
whoami # who am I?
hostname # which machine?
pwd # where am I?
ls # what's here?
ls -la # everything, in detail
cd / # go to the root of the filesystem
ls
cd ~ # back home
mkdir -p labs/module1
cd labs/module1
Explore the filesystem hierarchy — visit each and peek inside with ls:
| Dir | What lives there | Telecoms analogy |
|---|---|---|
/etc |
configuration | the site folder with all the config sheets |
/var/log |
logs | the alarm/event log printer |
/home |
user files | your desk drawer |
/bin, /usr/bin |
programs | the tool van |
/tmp |
scratch space | the bench |
/proc |
live kernel/process info | live line-test readouts |
Checkpoint: without notes: create ~/labs/module1/test/deep/dir in one command,
create an empty file in it, then delete the whole tree. (mkdir -p, touch, rm -r.)
1.2 Files, viewing and editing
cat /etc/os-release # dump a file
less /var/log/syslog # page through (q to quit, / to search)
head -20 /etc/passwd
tail -f /var/log/syslog # follow live — Ctrl-C to stop
cp /etc/hostname myhostname.txt
mv myhostname.txt hostname.bak
grep ubuntu /etc/passwd # search inside files
find /etc -name "*.conf" | head # find files by name
wc -l /etc/passwd # count lines
Lab 1.2 — nano then vim
nano notes.txt— write three lines, save (Ctrl-O), exit (Ctrl-X).vimtutor— complete lessons 1 and 2 (20 min, worth it: vim is on every server you will ever touch).- Survival vim:
vim notes.txt→ito insert → type →Esc→:wqto save-quit,:q!to abandon.
1.3 Pipes and redirection — the superpower
ls /etc | wc -l # pipe: output of one → input of next
grep -c bash /etc/passwd
ps aux | grep ssh
history | tail -20
ls /etc > etclist.txt # redirect stdout to file
ls /nonexistent 2> errors.txt # redirect stderr
ls /etc /nonexistent > all.txt 2>&1 # both
sort /etc/passwd | cut -d: -f1 | head # chains
Checkpoint: one command line that counts how many .conf files exist under
/etc (hint: find /etc -name "*.conf" 2>/dev/null | wc -l — why the 2>/dev/null?).
1.4 Users, groups, permissions, sudo
Theory: every file has owner/group/other × read/write/execute. root is god;
sudo borrows god powers per-command and is logged.
id
ls -l /etc/shadow # note: only root can read it
sudo tail -3 /etc/shadow
sudo adduser trainee
sudo usermod -aG sudo trainee
su - trainee # become them (their password)
exit
Lab 1.4 — Permission surgery
touch secret.txt
chmod 600 secret.txt && ls -l secret.txt # rw-------
chmod 644 secret.txt && ls -l secret.txt # rw-r--r--
chmod +x script.sh # make executable
sudo chown trainee:trainee secret.txt
Decode octal: 7=rwx, 6=rw-, 5=r-x, 4=r--. Checkpoint: what is 755 and where have
you already seen it today? (ls -l /usr/bin | head.)
1.5 Processes and services (systemd)
ps aux | head
top # q to quit; note load average, memory
htop # nicer (pre-installed on lab-box)
sleep 300 & # background job
jobs
kill %1
systemctl status ssh # the service keeping you connected
systemctl list-units --type=service --state=running
sudo systemctl restart ssh # yes, mid-session — what happens to you? why not?
journalctl -u ssh -n 20 # logs for one service
Telecoms mapping: systemd is the exchange's supervisory system — it starts services at boot, restarts them when they die, and keeps their event logs.
1.6 Packages, disks, networking basics
sudo apt update && sudo apt install -y tree cowsay
tree ~/labs | head
df -h # disk usage by filesystem
du -sh /var/log
free -h # memory
ip a # interfaces + addresses
ip route # routing table — find the default gateway
ss -tlnp # listening TCP ports (you'll use this constantly)
ping -c3 1.1.1.1
curl -I https://example.com # HTTP HEAD — first taste of module 2
1.7 Shell scripting — automate like an engineer
Lab 1.7 — Your first real script
vim ~/labs/module1/healthcheck.sh:
#!/usr/bin/env bash
# healthcheck.sh — first automation. Run: ./healthcheck.sh
set -euo pipefail
echo "=== Health report for $(hostname) at $(date) ==="
echo "-- Uptime/load:"; uptime
echo "-- Disk:"; df -h / | tail -1
echo "-- Memory:"; free -h | awk '/Mem/ {print $3 " used of " $2}'
echo "-- Top 3 CPU processes:"
ps aux --sort=-%cpu | head -4 | tail -3
if df -h / | tail -1 | awk '{gsub("%","",$5); exit ($5>80)?1:0}'; then
echo "DISK OK"
else
echo "WARNING: root disk above 80%"
fi
chmod +x healthcheck.sh
./healthcheck.sh
Then schedule it:
crontab -e # add: */5 * * * * ~/labs/module1/healthcheck.sh >> ~/health.log 2>&1
tail -f ~/health.log
You have just built a monitoring agent. In module 7 you'll replace it with Prometheus and see why the industrial version is better.
1.8 Sabotage session (instructor)
While the student is away, do two or three of these on lab-box; student diagnoses and fixes, narrating their reasoning out loud (field-engineer style):
chmod 000their healthcheck script.- Fill
/tmpwith a big file (fallocate -l 6G /tmp/big); watch them find it withdf/du. - Stop a service they now rely on:
sudo systemctl stop cron. - Add a nonsense line to
~/.bashrcthat prints a fake error at login. - Rename
lsin their PATH:alias ls='echo command not found'in.bashrc.
LPIC-1 coverage map
This module covers, hands-on, the core of LPIC-1 topics 101–110: system architecture (lightly), Linux installation/package management (apt), GNU & Unix commands, devices & filesystems, shells & scripting, user interfaces (skipped GUIs deliberately), administrative tasks (users, cron), essential services (systemd, logging), networking fundamentals, and security basics (permissions, sudo, ssh). For formal certification, add reading on: RPM/dnf (Red Hat side), runlevels history, localisation, and printing (rarely used in cloud work).
Quiz
1. What does chmod 640 file allow, exactly?
Owner: read+write. Group: read. Others: nothing.2. A service is "down". Give the three commands you run first.
systemctl status NAME, journalctl -u NAME -n 50,
ss -tlnp (is anything listening on its port?).3. Difference between | and >?
| feeds output into another command; > writes output into a file.