Ubuntu Linux Administration - Professional Course | iotinfo.in
Ubuntu Linux Administration
Ubuntu 26.04 LTS  Professional Course Material

Ubuntu Linux Administration: Professional Course Material

A complete, self-paced curriculum with worked examples, hands-on labs and unit quizzes. Use the sidebar to jump between units, and check off each one as you finish it — your progress is saved on this device.

10 units
Self-paced
Hands-on labs
Unit quizzes

Start here

Course Information

This course trains you to install, configure, secure, automate and troubleshoot Ubuntu systems at a professional level. It is built on Ubuntu 26.04 LTS "Resolute Raccoon" (released 23 April 2026, supported to April 2031) and notes where Ubuntu 26.10 "Stonking Stingray" (released 15 October 2026, supported to July 2027) differs.

Course at a glance

Item Detail
Title Ubuntu Linux Administration
Level Beginner to professional administrator
Duration 12 weeks, about 6 to 8 hours per week (about 80 hours)
Delivery Self-paced reading, hands-on labs, quizzes, capstone
Platform Ubuntu 26.04 LTS Desktop and Server (primary); Ubuntu 26.10 (reference)
Outcome Ability to run and secure production Ubuntu servers; preparation for LPIC-1, CompTIA Linux+ and LFCS

Version facts used in this course

Release Kernel Desktop Notes
Ubuntu 26.04 LTS Linux 7.0 GNOME 50, Wayland-only systemd 259 (cgroup v2 only); 5 years of standard support; up to 10 with Ubuntu Pro
Ubuntu 26.10 Linux 7.3 GNOME 51 Rust-based coreutils migration complete; 9 months of support

Learning outcomes

By the end you will be able to:

  1. Install Ubuntu Desktop and Server, and perform first-boot configuration.
  2. Work fluently on the command line and process text with standard tools.
  3. Manage software with apt, snap and repositories, and keep systems patched.
  4. Administer users, groups, permissions, processes and systemd services.
  5. Configure disks, LVM, RAID, encryption and a tested backup strategy.
  6. Configure networking with Netplan, a firewall with UFW/nftables, and secure SSH.
  7. Harden a server and audit it against a security baseline.
  8. Write safe Bash scripts and automate with cron, systemd timers, cloud-init and Ansible.
  9. Deploy web, database and container workloads and monitor them.
  10. Troubleshoot systematically and document your work.

Audience and prerequisites

  • Students, IT support staff, aspiring sysadmins, DevOps and cloud engineers.
  • No Linux experience required. Basic computer literacy and an understanding of IP addresses help.
  • Hardware: 16 GB RAM, 100 GB free disk, 64-bit CPU with virtualization enabled.

Lab environment

VM Role Resources
ubu-desktop Ubuntu 26.04 Desktop for Units 1 to 4 4 GB RAM, 2 vCPU, 40 GB disk
ubu-server1 Ubuntu Server 26.04, main lab server 2 GB RAM, 2 vCPU, 20 GB + two extra 5 GB disks
ubu-server2 Second server for networking, backup and Ansible labs 2 GB RAM, 1 vCPU, 20 GB disk

Use VirtualBox, VMware or KVM/virt-manager with a host-only plus NAT network. Take a snapshot before each lab so mistakes cost nothing.

Weekly schedule

Week Unit Lab
1 1 Foundations and installation Install desktop and server VMs
2 2 Command line Text-processing challenge
3 3 Package management Repositories, snaps, unattended upgrades
4 4 Users, permissions, services Shared project directory, custom service
5 5 Storage and backups LVM, RAID, restic backup and restore
6 6 Networking Static IP, UFW, key-based SSH
7 7 Security hardening Lynis audit and remediation
8 8 Shell scripting Automation toolkit
9 8 cont. cloud-init and Ansible
10 9 Server services LEMP stack and containers
11 9 cont. Monitoring and logging
12 10 Troubleshooting and capstone Capstone and final practical

Assessment

Component Weight
Unit quizzes 20%
Labs (documented, reproducible) 35%
Capstone project and write-up 30%
Final timed practical (3 hours) 15%

Pass mark: 70% overall, with at least 60% in the capstone.

How to use this material

  • Read the concept section, type every command yourself, then do the lab without copying from the text.
  • Keep a lab journal (commands, output, what failed and why).
  • Use man, --help and /usr/share/doc for details; they work offline.

Unit 1

Linux and Ubuntu foundations, installation and first boot

Learning objectives: explain how Linux and Ubuntu are built and released; install Ubuntu Desktop and Server; complete essential first-boot configuration.

1.1What Linux is

Linux is an operating-system kernel written by Linus Torvalds and developed by thousands of contributors. A distribution (distro) combines the kernel with the GNU userland, an init system, a package manager and applications. Ubuntu is a Debian-based distribution published by Canonical. Debian-family knowledge (apt, dpkg, /etc layout, systemd) applies to Ubuntu, Kali, Mint and Debian itself.

Core ideas:

  • Kernel space vs user space: the kernel schedules processes, manages memory and talks to hardware; everything else runs in user space.
  • Everything is a file: devices (/dev), kernel interfaces (/proc, /sys) and sockets are accessed like files.
  • Multi-user, permission-based security: every file and process has an owner and a set of permissions.
  • Open source licensing: GPL, MIT, Apache 2.0; you may study, modify and redistribute.

1.2Ubuntu release model

Type Cadence Support Use for
LTS (April of even years) Every 2 years 5 years standard; Ubuntu Pro adds ESM up to 10 years Servers, production, learning
Interim (April and October) Every 6 months 9 months Developers who want the newest kernel and toolchain

Version format is YY.MM: 26.04 means April 2026. Each release has an alliterative codename (26.04 Resolute Raccoon, 26.10 Stonking Stingray). LTS point releases (26.04.1, 26.04.2, ...) bundle updates and enable upgrades from the previous LTS.

Changes in 26.04 LTS worth knowing: the GNOME session is Wayland-only (Xorg session removed, X11 apps run via Xwayland); the kernel is Linux 7.0; systemd 259 runs with cgroup v2 only; sudo shows asterisks while you type a password; Resources replaces the old system monitor; NVIDIA CUDA and AMD ROCm are available natively.

1.3Ubuntu editions and flavours

Edition Purpose
Ubuntu Desktop GNOME desktop for workstations
Ubuntu Server Text-mode installer, no desktop, for servers and cloud
Ubuntu Cloud images Preinstalled images for AWS, Azure, GCP, OpenStack (use cloud-init)
Ubuntu Core Immutable, snap-only OS for IoT
Flavours Kubuntu (KDE), Xubuntu (Xfce), Lubuntu (LXQt), Ubuntu MATE, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Studio
Ubuntu on WSL Ubuntu inside Windows, with systemd and cloud-init support

1.4System requirements

Edition Minimum recommended
Desktop 26.04 LTS 2 GHz dual-core CPU, 6 GB RAM, 25 GB disk
Server 26.04 LTS From 1.5 GB RAM and 4 GB disk, depending on workload

1.5Installing Ubuntu Desktop

  1. Download the ISO from ubuntu.com. Verify it: sha256sum ubuntu-26.04-desktop-amd64.iso and compare with the SHA256SUMS file (also verify the GPG signature in production).
  2. Create a bootable USB with Balena Etcher, Rufus or dd: sudo dd if=ubuntu.iso of=/dev/sdX bs=4M status=progress conv=fsync (double-check the device name; dd overwrites without asking).
  3. Boot the media (F12, F10 or Esc on most machines; UEFI with Secure Boot works).
  4. Choose language, keyboard, network and updates, then the install type: - Erase disk and install (simplest, destroys data). - Manual partitioning for dual boot or custom layouts. - Optional encryption: TPM-backed full-disk encryption on supported hardware, or LUKS with a passphrase.
  5. Create your account (strong password, enable "require password to log in").
  6. Reboot, remove media, and log in.

Typical manual partition plan (UEFI):

Mount Size Filesystem
/boot/efi 512 MB FAT32 (EFI System Partition)
/ 30 GB or more ext4
swap Equal to RAM up to 8 GB, or a swap file swap
/home Rest of disk ext4

1.6Installing Ubuntu Server

  1. Boot the Server ISO and select language and keyboard.
  2. Choose the base (Ubuntu Server or minimized), configure the network (DHCP or static), proxy and mirror.
  3. Storage: guided layout, optionally with LVM and encryption, or custom.
  4. Profile: server name, user and password.
  5. Select Install OpenSSH server and import keys from GitHub or Launchpad (gh:username, lp:username).
  6. Optionally select featured snaps (Docker, Nextcloud, etc.). Skip them in the lab.
  7. Wait for the install, then reboot and log in over SSH.

1.7First-boot checklist

# 1. update everything
sudo apt update && sudo apt full-upgrade -y

# 2. identify the system
lsb_release -a ; hostnamectl ; uname -r

# 3. hostname, timezone, time sync
sudo hostnamectl set-hostname ubu-server1
sudo timedatectl set-timezone Asia/Kolkata
timedatectl

# 4. install useful base tools
sudo apt install -y vim curl wget git htop tree net-tools unzip ca-certificates

# 5. enable automatic security updates
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

# 6. reboot if required
[ -f /var/run/reboot-required ] && sudo reboot

1.8The Ubuntu desktop in brief

  • Activities overview: Super key; search apps, switch workspaces.
  • Settings: network, displays, users, privacy, power, Ubuntu Pro status.
  • App Center: install apps from snaps and debs.
  • Terminal: Ctrl+Alt+T. Useful shortcuts: Ctrl+Shift+C/V copy and paste, Ctrl+L clear, Ctrl+R history search, Ctrl+C cancel.
  • Wayland note: some screen-recording and remote-desktop tools need PipeWire and portal support; use GNOME's built-in remote desktop for sharing.

Hands-on Lab

Lab 1: build your lab

  1. Create ubu-desktop and ubu-server1 VMs from the 26.04 ISOs.
  2. Complete the first-boot checklist on both and record the output of hostnamectl and uname -r.
  3. From the desktop VM, SSH into the server: ssh user@<server-ip>.
  4. Snapshot both VMs as "base-clean".

Deliverable: a one-page lab journal with versions, IP addresses and any issues you solved.

Unit Quiz

Unit 1 quiz

  1. Which components make a Linux distribution besides the kernel?
  2. How long is an Ubuntu LTS supported, and what does Ubuntu Pro add?
  3. What does "Wayland-only" mean for Ubuntu 26.04 and how are X11 apps still supported?
  4. Why verify an ISO checksum before installing?
  5. Name three first-boot tasks every server should get.

Unit 2

The command line, filesystem and text processing

Learning objectives: navigate and manage files; combine commands with pipes and redirection; search and transform text; use the shell efficiently.

2.1Shell basics

The shell interprets commands. Ubuntu's default is Bash (/bin/bash); echo $SHELL shows yours and cat /etc/shells lists installed shells. A command has the form command [options] [arguments], for example ls -l /etc.

  • Prompt: user@host:~$ ($ normal user, # root).
  • Getting help: man ls (manual), ls --help, info coreutils, apropos copy, type cd, which python3, whatis grep.
  • Manual sections: 1 commands, 5 file formats, 8 admin commands (man 5 passwd).
  • Efficiency: Tab completion, Ctrl+R reverse search, !! repeat last command, !$ last argument, history, alias ll='ls -lah' (put in ~/.bashrc).

2.2Filesystem Hierarchy Standard

Path Purpose
/ Root of the tree
/home/<user> User data and settings
/root Root user's home
/etc System configuration (text files)
/var/log Logs; /var/lib application data; /var/cache caches; /var/www web roots
/usr/bin, /usr/sbin, /usr/lib Programs and libraries (/bin, /sbin, /lib are symlinks to these)
/usr/local Software you install manually
/opt Self-contained third-party software
/tmp Temporary files, cleared at boot
/run Runtime data (PID files, sockets), in RAM
/dev Device nodes (/dev/sda, /dev/null)
/proc, /sys Kernel and hardware information (virtual)
/mnt, /media Mount points
/srv Data served by this system
/boot Kernel, initramfs, bootloader

Paths: absolute (/etc/hosts), relative (../docs), home shortcut (~), current directory (.), parent (..).

2.3Working with files and directories

Task Command
Where am I / change directory pwd, cd /var/log, cd ~, cd -
List ls, ls -l, ls -lah, ls -lt (newest first), ls -R
Create dirs / files mkdir -p a/b/c, touch f.txt
Copy cp f.txt g.txt, cp -a dir backup/ (preserve all attributes)
Move / rename mv old new
Delete rm f, rm -r dir, rmdir emptydir (no recycle bin; consider trash-cli)
Links ln -s /etc/nginx/nginx.conf link (symlink), ln a b (hard link)
Inspect file f, stat f, du -sh dir, df -h, tree -L 2
Wildcards * any string, ? one char, [a-c] range, {a,b} brace expansion

Difference between hard and symbolic links: a hard link is another name for the same inode (same filesystem only; survives deleting the original); a symlink is a pointer by path (can cross filesystems; breaks if the target is removed).

Ubuntu 26.10 note: cp, mv and rm come from the Rust uutils project. Normal use is unchanged; scripts relying on obscure GNU-only flags should be tested.

2.4Viewing files

  • cat f whole file, less f pager (/word search, q quit, G end), head -n 20 f, tail -n 50 f, tail -f /var/log/syslog follow live.
  • wc -l f count lines; sort, uniq -c, cut, tr, column -t reshape output.
  • Compare: diff -u a b, cmp, sha256sum to check integrity.

2.5Finding things

find /etc -type f -name "*.conf"            # by name
find /var/log -type f -size +50M            # by size
find /home -type f -mtime -2                # modified in the last 2 days
find . -type f -name "*.tmp" -delete        # act on results
find . -type f -exec chmod 644 {} +         # run a command on matches
locate nginx.conf                           # fast, uses a database (sudo updatedb)
whereis ssh ; which ssh                     # programs and manuals

2.6Text processing

grep searches patterns: grep -rin "error" /var/log, grep -v '^#' file (exclude comments), grep -E 'a|b' (extended regex), grep -c, grep -A3 -B3 (context).

sed edits streams: sed 's/old/new/g' f, sed -i.bak 's/foo/bar/' f (in place with backup), sed -n '10,20p' f, sed '/^$/d' f (delete blank lines).

awk works on fields: awk -F: '{print $1,$3}' /etc/passwd, awk '$3>1000' /etc/passwd, awk '{s+=$1} END{print s}' nums.txt.

Regular expressions cheat sheet:

Pattern Meaning
. Any character
^ / $ Start / end of line
*, +, ? 0 or more, 1 or more, 0 or 1
[abc], [^abc] Any of / none of
\d, \w (PCRE) Digit, word character
`(a b)`
{n,m} Repetition range

Real-world pipeline: top 10 IPs hitting a web server

awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -10

2.7Streams, redirection, pipes

Syntax Effect
cmd > f / cmd >> f Write / append stdout
cmd 2> f Write stderr
cmd > f 2>&1 or cmd &> f stdout and stderr together
cmd < f Read stdin from file
cmd1 \| cmd2 Pipe stdout to stdin
cmd \| tee f Display and save
cmd 2>/dev/null Discard errors
cmd1 && cmd2 / cmd1 \|\| cmd2 Run on success / failure

Quoting: single quotes are literal; double quotes allow $var and $(command); backslash escapes one character.

2.8Environment and shell configuration

  • Variables: NAME=value (shell), export NAME=value (inherited by children), echo "$PATH", env, printenv.
  • Startup files: /etc/profile, ~/.profile, ~/.bashrc (interactive), ~/.bash_aliases.
  • Add a directory to PATH: export PATH="$HOME/bin:$PATH" in ~/.bashrc, then source ~/.bashrc.

2.9Archives and compression

tar -czf backup.tar.gz /home/me/docs        # create gzip archive
tar -xzf backup.tar.gz -C /tmp/restore      # extract to a directory
tar -tzf backup.tar.gz                      # list contents
tar --zstd -cf data.tar.zst data/           # fast modern compression
zip -r site.zip site/ ; unzip site.zip

2.10Editors

  • nano: nano file; Ctrl+O save, Ctrl+X exit, Ctrl+W search.
  • vim: modes (normal, insert, visual, command). i insert, Esc leave, :w save, :q quit, :wq both, :q! discard, dd delete line, yy copy, p paste, u undo, /text search, :%s/old/new/g replace all. Run vimtutor.

Hands-on Lab

Lab 2: text-processing challenge

  1. Create ~/lab2/{logs,data,out}; copy /var/log/auth.log (or create it with journalctl -u ssh > ~/lab2/logs/ssh.log).
  2. Produce out/failed_ips.txt: unique source IPs of failed SSH logins with counts, sorted descending.
  3. Produce out/users.txt: list of login shells in use from /etc/passwd, with counts.
  4. Find all files over 10 MB under /var and write their sizes in human-readable form.
  5. Archive ~/lab2, delete it, and restore it from the archive; verify with diff -r.

Deliverable: your commands in lab2.sh with a short explanation of each pipeline.

Unit Quiz

Unit 2 quiz

  1. Which directory stores system-wide configuration and which stores logs?
  2. Difference between a hard link and a symbolic link?
  3. What does 2>&1 do?
  4. Write a command that counts how many users use /bin/bash.
  5. How do you search recursively and case-insensitively for "timeout" in /etc?

Unit 3

Package management, software sources and updates

Learning objectives: install, query, update and remove software safely; manage repositories and keys; use snaps and Flatpak; maintain systems with automatic updates and Ubuntu Pro.

3.1How Debian-style packaging works

  • A package (.deb) contains files plus metadata: version, dependencies, maintainer scripts.
  • dpkg is the low-level tool that installs a single .deb. apt resolves dependencies and downloads from repositories.
  • Repositories are signed archives. Ubuntu components: main (Canonical-supported open source), universe (community), restricted (proprietary drivers), multiverse (non-free). Pockets: release, -security, -updates, -backports, -proposed.
  • Package lists are cached in /var/lib/apt/lists/; downloaded debs in /var/cache/apt/archives/.

3.2apt command reference

Task Command
Refresh package index sudo apt update
Upgrade installed packages (never removes) sudo apt upgrade
Upgrade, allowing installs and removals sudo apt full-upgrade
Install (several at once) sudo apt install nginx curl
Install a specific version sudo apt install nginx=1.26.3-1ubuntu1
Reinstall sudo apt install --reinstall pkg
Remove (keep config) sudo apt remove pkg
Remove with config sudo apt purge pkg
Remove unused dependencies sudo apt autoremove
Search apt search web server
Show details and dependencies apt show nginx, apt depends nginx, apt rdepends nginx
Show candidate and installed versions apt policy nginx
List installed / upgradable apt list --installed, apt list --upgradable
Hold a package at its version sudo apt-mark hold pkg, apt-mark showhold, sudo apt-mark unhold pkg
Simulate only apt -s upgrade
Download only apt download pkg
Clean caches sudo apt clean, sudo apt autoclean

apt is the friendly interactive front-end. In scripts use apt-get or apt with -y and DEBIAN_FRONTEND=noninteractive for stability. Recent releases ship APT 3.x, which also gives command-specific --help.

3.3dpkg and file queries

dpkg -l | grep nginx             # installed packages
dpkg -L nginx                    # files installed by a package
dpkg -S /usr/sbin/nginx          # which package owns a file
sudo dpkg -i package.deb         # install a local .deb (use apt install ./package.deb instead for dependencies)
sudo dpkg --configure -a         # finish interrupted installs
sudo apt --fix-broken install    # repair dependency problems

3.4Repository configuration

  • Main sources: /etc/apt/sources.list.d/ubuntu.sources (deb822 format) and any extra *.sources files.
  • Example deb822 entry for a third-party repository:
Types: deb
URIs: https://repo.example.com/ubuntu
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/example.gpg
  • Add the key with sudo install -d -m 0755 /etc/apt/keyrings then curl -fsSL https://repo.example.com/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/example.gpg. Do not use the deprecated apt-key.
  • PPAs: sudo add-apt-repository ppa:user/name and sudo add-apt-repository --remove ppa:user/name. Treat PPAs as untrusted code with root access; prefer official repositories.
  • Choose a mirror close to you (country mirrors, for example in.archive.ubuntu.com) for faster downloads.
  • Pinning (/etc/apt/preferences.d/) controls which source wins when versions conflict.

3.5Snap packages

Snaps are sandboxed, self-updating packages from the Snap Store.

Task Command
Find / install snap find vlc, sudo snap install vlc, sudo snap install code --classic
List / info snap list, snap info vlc
Update sudo snap refresh (automatic, several times a day)
Roll back sudo snap revert vlc
Remove sudo snap remove vlc
Channels sudo snap refresh vlc --channel=latest/beta
Pause updates sudo snap refresh --hold=24h
Permissions snap connections vlc, sudo snap connect vlc:removable-media

Trade-offs: snaps give newer apps and isolation, but start slightly slower and use more disk. Core system tools remain debs.

3.6Flatpak (optional)

sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gimp.GIMP
flatpak update

3.7Building from source (when nothing else works)

sudo apt install build-essential
./configure --prefix=/usr/local && make -j"$(nproc)" && sudo make install

Prefer checkinstall or a container, so the software can be removed cleanly. Put manual installs in /usr/local or /opt.

3.8Automatic updates and livepatch

  • unattended-upgrades installs security updates automatically. Configure in /etc/apt/apt.conf.d/50unattended-upgrades (allowed origins, Automatic-Reboot, mail alerts) and 20auto-upgrades:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
  • Test: sudo unattended-upgrade --dry-run --debug; logs in /var/log/unattended-upgrades/.
  • Kernel Livepatch (via Ubuntu Pro) applies critical kernel fixes without a reboot.
  • Servers: schedule reboot windows. Check /var/run/reboot-required; use needrestart to find services running old libraries.

3.9Ubuntu Pro

Ubuntu Pro extends security coverage and adds compliance tooling. It is free for personal use on up to five machines.

sudo pro attach <token>
pro status
sudo pro enable esm-infra esm-apps livepatch
pro security-status        # how many packages are covered

Features: Expanded Security Maintenance (up to 10 years for an LTS, to April 2036 for 26.04), Livepatch, FIPS-certified components, Ubuntu Security Guide for CIS and DISA-STIG profiles, Landscape management.

3.10Upgrading Ubuntu releases

  • Upgrade path is LTS to next LTS (24.04 to 26.04), normally enabled when the first point release is out; interim releases can upgrade to the next one.
  • Procedure: back up, update fully, reboot, then sudo do-release-upgrade (use -d only to test development releases). Over SSH it opens a backup SSH port (1022) in case your session drops.
  • Check the release notes for known issues and third-party repository handling before upgrading.

Hands-on Lab

Lab 3: repositories, updates and Pro

  1. Install nginx, htop, tree. Use apt show, dpkg -L and dpkg -S to answer: which files does nginx install, which package owns /usr/bin/tree?
  2. Hold htop, confirm it is held, then unhold it.
  3. Install VLC as a snap, refresh, check snap list, then revert and remove it.
  4. Configure unattended-upgrades and run a dry run; record the log output.
  5. Attach (or simulate) Ubuntu Pro and run pro security-status.
  6. Add a third-party repository the secure way (keyring file plus Signed-By) and remove it again.

Deliverable: commands and outputs for each step, plus a short note on when you would choose a snap over a deb.

Unit Quiz

Unit 3 quiz

  1. Difference between apt update and apt upgrade?
  2. When must you use full-upgrade?
  3. Why is apt-key deprecated and what replaces it?
  4. What do main, universe, restricted and multiverse mean?
  5. How do you find which package installed /usr/sbin/nginx?
  6. What does Ubuntu Pro add to an LTS and for how long?

Unit 4

Users, permissions, processes, systemd and scheduling

Learning objectives: manage accounts and groups; set precise file permissions and ACLs; control processes and resources; operate and write systemd units; schedule jobs.

4.1Accounts and groups

File Content
/etc/passwd name:x:UID:GID:comment:home:shell for each account
/etc/shadow Password hashes and ageing data (readable by root only)
/etc/group Group names, GIDs, members
/etc/sudoers, /etc/sudoers.d/ Who may run what as whom
/etc/login.defs, /etc/adduser.conf Defaults (UID ranges, password ageing, home dir mode)

UID 0 is root; system accounts typically use UIDs below 1000; regular users start at 1000. Ubuntu locks the root password by default, so administrators use sudo.

sudo adduser alice                       # interactive, creates home, sets password
sudo useradd -m -s /bin/bash -G sudo bob # low-level, scriptable
sudo passwd alice                        # set or change password
sudo chage -l alice ; sudo chage -M 90 -W 7 alice   # ageing
sudo usermod -aG docker alice            # append to a group (never omit -a)
sudo usermod -L alice ; sudo usermod -U alice       # lock / unlock
sudo deluser --remove-home bob           # delete user and home
sudo groupadd devs ; sudo gpasswd -a alice devs
id alice ; groups alice ; getent passwd alice
last ; lastb ; w ; who                   # login history and sessions

sudo policy: always edit with sudo visudo (syntax-checked) or drop files in /etc/sudoers.d/ (mode 0440). Example granting a group service control only:

%ops ALL=(root) NOPASSWD: /usr/bin/systemctl restart nginx, /usr/bin/systemctl status nginx

Principle of least privilege: grant specific commands, not blanket ALL.

4.2File permissions

A listing -rwxr-x--- shows type, then owner, group and other triplets: read = 4, write = 2, execute = 1.

Permission On a file On a directory
r Read content List names
w Modify content Create, rename, delete entries (needs x)
x Execute Enter (cd) and access entries
Command Effect
chmod 640 f rw- for owner, r-- for group, none for others
chmod u+x,g-w f Symbolic mode changes
chmod -R o-rwx dir Remove all access for others, recursively
chown alice:devs f, chown -R www-data: /var/www Change owner and group
umask 027 New files default to 640, directories to 750
chmod 4755 prog setuid: runs as the file owner
chmod 2775 dir setgid on a directory: new files inherit the group
chmod 1777 /tmp Sticky bit: only the owner can delete their files
chattr +i f, lsattr f Immutable flag, even root cannot modify until removed

ACLs add per-user or per-group rules: sudo apt install acl, setfacl -m u:bob:rw f, setfacl -d -m g:devs:rwx dir (default for new files), getfacl f.

Audit setuid and world-writable files regularly:

find / -xdev -perm -4000 -type f 2>/dev/null
find / -xdev -type f -perm -0002 2>/dev/null

4.3Processes and resources

Task Commands
List ps aux, ps -ef --forest, pstree -p, pgrep -a ssh
Live view top, htop (sort with F6), btop
Signals kill PID (SIGTERM, graceful), kill -HUP PID (reload), kill -9 PID (SIGKILL, last resort), pkill -u bob, killall name
Priority nice -n 10 cmd, renice 5 -p PID (range -20 high to 19 low)
Jobs cmd &, jobs, fg %1, bg %1, Ctrl+Z suspend, nohup cmd &, disown
Persistent sessions tmux new -s work, detach with Ctrl+B then D, tmux attach -t work
Memory free -h, vmstat 1 5, cat /proc/meminfo
Open files and ports lsof -p PID, lsof -i :443, ss -tulpn
Limits ulimit -a, /etc/security/limits.conf

Process states: R running, S sleeping, D uninterruptible (usually I/O), T stopped, Z zombie (waiting for parent). The OOM killer terminates processes when memory runs out; check journalctl -k | grep -i 'out of memory'.

Ubuntu 26.04 uses cgroup v2 only, so resource control uses systemd-run --scope -p MemoryMax=500M -p CPUQuota=50% cmd and systemctl set-property.

4.4systemd

systemd (version 259 in 26.04) is the init system and service manager. Units: .service, .timer, .socket, .mount, .target, .path.

Task Command
Status systemctl status nginx
Start / stop / restart / reload `sudo systemctl start
Enable / disable at boot sudo systemctl enable --now nginx, sudo systemctl disable nginx
Mask (prevent start) sudo systemctl mask unit
List running / failed systemctl list-units --type=service, systemctl --failed
List enabled systemctl list-unit-files --state=enabled
Dependencies systemctl list-dependencies nginx
Edit safely sudo systemctl edit nginx (override file), systemctl cat nginx
Reload unit files sudo systemctl daemon-reload
Boot analysis systemd-analyze, systemd-analyze blame, systemd-analyze critical-chain
Targets systemctl get-default, sudo systemctl set-default multi-user.target
Power `sudo systemctl reboot

Writing a service: /etc/systemd/system/myapp.service

[Unit]
Description=My application
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=myapp
Group=myapp
WorkingDirectory=/opt/myapp
ExecStart=/opt/myapp/bin/server --port 8080
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
ReadWritePaths=/var/lib/myapp

[Install]
WantedBy=multi-user.target

Then sudo systemctl daemon-reload && sudo systemctl enable --now myapp. The Protect* and NoNewPrivileges lines are free hardening. Score exposure with systemd-analyze security myapp.

Logging with journald:

journalctl -u nginx -f              # follow a unit
journalctl -b                       # this boot; -b -1 previous boot
journalctl -p err -S today          # errors since midnight
journalctl --since "1 hour ago" -u ssh
journalctl -k                       # kernel messages
sudo journalctl --vacuum-size=500M  # shrink logs

Make the journal persistent by creating /var/log/journal and restarting systemd-journald.

4.5Scheduling work

cron: crontab -e (per user), /etc/cron.d/, /etc/cron.daily/. Format: minute hour day month weekday command.

30 2 * * *   /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1   # 02:30 daily
*/15 * * * * /usr/local/bin/check.sh                                 # every 15 min
0 6 * * 1-5  /usr/local/bin/report.sh                                # 06:00 weekdays
@reboot      /usr/local/bin/startup.sh

systemd timer (better logging, catch-up after downtime, resource control):

# /etc/systemd/system/backup.timer
[Unit]
Description=Nightly backup
[Timer]
OnCalendar=*-*-* 02:30:00
Persistent=true
[Install]
WantedBy=timers.target

Pair it with backup.service (Type=oneshot), run sudo systemctl enable --now backup.timer, check with systemctl list-timers. One-off jobs: at now + 2 hours.

4.6Boot process in brief

Firmware (UEFI) then bootloader (GRUB) then kernel and initramfs then systemd (default target) then services and login. Configuration: /etc/default/grub, apply with sudo update-grub. To recover from a failed boot use GRUB's recovery mode, or add systemd.unit=rescue.target to the kernel line temporarily.

Hands-on Lab

Lab 4: shared project and custom service

  1. Create users alice, bob, carol and group devs (alice and bob only).
  2. Create /srv/project with owner root:devs, mode 2770; prove alice and bob can collaborate and carol cannot enter. Add an ACL giving carol read-only access and verify.
  3. Create a sudoers drop-in letting devs restart one service only.
  4. Write a small script that serves a page (for example python3 -m http.server 8080), wrap it in a hardened systemd unit with a dedicated user, make it restart on failure, kill it with kill -9, and show it restarts. Record systemd-analyze security.
  5. Replace a cron job with a systemd timer and read its history in journalctl.

Deliverable: commands, outputs and a one-paragraph explanation of the permission design.

Unit Quiz

Unit 4 quiz

  1. What does chmod 2770 dir do and why is it useful for team folders?
  2. Why use usermod -aG rather than -G?
  3. Difference between systemctl stop, disable and mask?
  4. What is a zombie process and how do you clear it?
  5. List two benefits of a systemd timer over cron.
  6. Write a cron entry that runs a script at 03:15 on the first day of every month.

Unit 5

Storage, LVM, RAID, encryption and backups

Learning objectives: inspect and partition disks; create and mount filesystems; use LVM and software RAID; encrypt volumes; design, run and test backups.

5.1Inspecting storage

lsblk -f                    # block devices, filesystems, UUIDs, mount points
sudo blkid                  # UUIDs and types
df -hT                      # filesystem usage and type
du -sh /var/* | sort -h     # which directories are big
findmnt                     # tree of mounts
sudo smartctl -a /dev/sda   # disk health (apt install smartmontools)
sudo fdisk -l ; sudo parted -l
iostat -xz 1                # I/O load (apt install sysstat)

Device names: /dev/sda (SATA/SCSI), /dev/nvme0n1 (NVMe), /dev/vda (virtio VMs); partitions sda1, nvme0n1p1.

5.2Partitioning and filesystems

  • MBR vs GPT: GPT supports disks over 2 TB and many partitions; UEFI systems use GPT with an EFI System Partition.
  • Tools: fdisk (interactive), parted, sfdisk (scriptable), gdisk.
sudo parted /dev/sdb --script mklabel gpt mkpart data ext4 1MiB 100%
sudo mkfs.ext4 -L data /dev/sdb1          # or mkfs.xfs, mkfs.btrfs
sudo mkdir -p /srv/data
sudo mount /dev/sdb1 /srv/data
sudo tune2fs -l /dev/sdb1                  # filesystem properties
Filesystem Strengths Notes
ext4 Mature, default, resilient Good general purpose
XFS Large files, parallel I/O Cannot be shrunk
Btrfs Snapshots, checksums, compression Needs btrfs-progs
ZFS Pools, snapshots, replication, data integrity Supported on Ubuntu (zfsutils-linux)
FAT32 / exFAT Compatibility with other OSes No Unix permissions
tmpfs RAM-backed temporary storage Lost at reboot

Persistent mounts: add to /etc/fstab using the UUID:

UUID=2f6a...-...  /srv/data  ext4  defaults,noatime  0  2

Test with sudo mount -a before rebooting; an error here can stop boot. Useful options: noexec,nosuid,nodev for data and upload directories, ro for read-only, nofail for removable drives.

Grow an ext4 filesystem after enlarging a partition: sudo resize2fs /dev/sdb1. XFS: sudo xfs_growfs /srv/data.

Swap: sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile, then add /swapfile none swap sw 0 0 to /etc/fstab. Check with swapon --show.

5.3Logical Volume Manager (LVM)

LVM adds a flexible layer: PV (physical volume) then VG (volume group) then LV (logical volume).

sudo pvcreate /dev/sdb /dev/sdc
sudo vgcreate vg_data /dev/sdb /dev/sdc
sudo lvcreate -L 8G -n lv_web vg_data
sudo mkfs.ext4 /dev/vg_data/lv_web
sudo mount /dev/vg_data/lv_web /var/www

# grow online by 2 GB and resize the filesystem together
sudo lvextend -r -L +2G /dev/vg_data/lv_web

# add a disk to the pool
sudo vgextend vg_data /dev/sdd

# snapshot for consistent backups, then remove
sudo lvcreate -s -n web_snap -L 1G /dev/vg_data/lv_web
sudo lvremove /dev/vg_data/web_snap

sudo pvs ; sudo vgs ; sudo lvs         # inventory

Shrinking is risky; back up first and shrink the filesystem before the LV (ext4 only).

5.4Software RAID with mdadm

Level Min disks Capacity Tolerates Use
RAID 0 2 Sum 0 failures Speed only
RAID 1 2 One disk 1 failure Mirroring
RAID 5 3 N-1 1 failure Balanced
RAID 6 4 N-2 2 failures Large arrays
RAID 10 4 N/2 1 per mirror pair Performance and safety
sudo apt install mdadm
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
cat /proc/mdstat ; sudo mdadm --detail /dev/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u
# replace a failed disk
sudo mdadm /dev/md0 --fail /dev/sdb --remove /dev/sdb
sudo mdadm /dev/md0 --add /dev/sdd

RAID is not a backup: it protects against disk failure, not deletion, ransomware or corruption.

5.5Disk encryption

  • At install time: choose encrypted LVM (LUKS) or, on supported hardware, TPM-backed full-disk encryption in the 26.04 installer.
  • Additional volumes with LUKS:
sudo apt install cryptsetup
sudo cryptsetup luksFormat /dev/sdb1               # destroys data; set a strong passphrase
sudo cryptsetup open /dev/sdb1 secure
sudo mkfs.ext4 /dev/mapper/secure
sudo mount /dev/mapper/secure /mnt/secure
# close
sudo umount /mnt/secure ; sudo cryptsetup close secure
# add to /etc/crypttab for unlock at boot (keyfile or prompt)
  • Back up the LUKS header (cryptsetup luksHeaderBackup) and store it safely offline.
  • File-level options: gpg -c file, age, fscrypt, gocryptfs for per-directory encryption.

5.6Quotas and disk-space hygiene

  • User quotas: apt install quota, add usrquota to /etc/fstab, quotacheck, edquota -u alice.
  • Find big files: sudo ncdu / (install ncdu), find / -xdev -size +500M.
  • Rotate logs with logrotate (/etc/logrotate.d/), vacuum the journal, clean apt and snap caches (sudo snap list --all, remove disabled revisions).

5.7Backup strategy

3-2-1 rule: keep 3 copies of data, on 2 different media, with 1 copy off-site (or offline/immutable). Define:

Term Meaning
RPO (recovery point objective) How much data you can afford to lose (time between backups)
RTO (recovery time objective) How long you can be down before restore completes
Full / incremental / differential Complete copy / changes since last backup / changes since last full
Retention How many generations you keep (for example 7 daily, 4 weekly, 12 monthly)

Tools

# rsync mirror (simple, fast; no history)
rsync -aHAX --delete --info=progress2 /srv/data/ backup@nas:/backups/data/

# restic: encrypted, deduplicated, snapshotted (local, SFTP, S3 and more)
sudo apt install restic
restic init --repo /srv/backup/repo
restic -r /srv/backup/repo backup /etc /home /srv/data --exclude-caches
restic -r /srv/backup/repo snapshots
restic -r /srv/backup/repo forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
restic -r /srv/backup/repo restore latest --target /tmp/restore --include /etc/nginx
restic -r /srv/backup/repo check

# borgbackup is a similar alternative
# tar for simple archives
sudo tar --xattrs --acls -czf /srv/backup/etc-$(date +%F).tgz /etc

Databases: use consistent dumps, not raw files: pg_dump -Fc db > db.dump, mariadb-dump --single-transaction db > db.sql.

Snapshots: LVM, Btrfs and ZFS snapshots are instant and ideal for consistent images, but remain on the same disks; replicate them elsewhere.

Bare-metal and VM recovery: keep a documented rebuild procedure; export VM images; store configuration in Git or Ansible so a server can be recreated, then restore data.

A backup does not exist until a restore has been tested. Schedule a restore drill every quarter and log the result.

5.8Disaster recovery quick reference

Situation Action
Disk full df -h, du, journalctl --vacuum-size, remove old kernels (sudo apt autoremove --purge)
Filesystem errors Boot rescue mode, unmount, fsck -f /dev/sdXn
Boot fails after fstab edit Boot rescue target, fix /etc/fstab, use nofail for non-critical mounts
Deleted file Restore from restic/snapshot; extundelete is a last resort and unreliable
RAID degraded mdadm --detail, replace disk, watch rebuild in /proc/mdstat

Hands-on Lab

Lab 5: LVM, RAID and a tested backup

  1. Add two 5 GB disks to ubu-server1. Create a RAID 1 array, put LVM on it, create an LV, format and mount it persistently.
  2. Extend the LV online by 1 GB and confirm with df -h that the filesystem grew.
  3. Create a LUKS-encrypted volume on a third disk and mount it; prove the data is unreadable when closed.
  4. Initialise a restic repository on a separate disk, back up /etc and a data directory, change files, and restore a specific file from the previous snapshot.
  5. Simulate a disk failure in the RAID array and recover.

Deliverable: commands, outputs and your backup policy (RPO, RTO, retention, location of copies).

Unit Quiz

Unit 5 quiz

  1. Why use UUIDs in /etc/fstab and what option helps a server boot when a drive is absent?
  2. Name the three LVM layers and the benefit of LVM over plain partitions.
  3. Why is RAID not a backup?
  4. State the 3-2-1 rule.
  5. What is the difference between RPO and RTO?
  6. How would you restore a single file from a restic snapshot?

Unit 6

Networking, name services, firewall and secure remote access

Learning objectives: configure static and dynamic networking with Netplan and NetworkManager; understand and troubleshoot DNS and routing; run DHCP/DNS services; build a default-deny firewall; deploy hardened SSH.

6.1Network configuration stack

Layer Server Desktop
Configuration front-end Netplan (/etc/netplan/*.yaml) Netplan hands off to NetworkManager (GUI, nmcli, nmtui)
Backend systemd-networkd NetworkManager
Name resolution systemd-resolved (resolvectl) systemd-resolved
Time sync systemd-timesyncd or chrony same

Interface names are predictable (enp0s3, ens33, wlp2s0). Show them with ip -br link.

6.2Inspecting the network

Goal Command
Addresses and links ip -br a, ip -s link show enp0s3 (statistics)
Routing table ip route, ip route get 8.8.8.8
Neighbour (ARP) table ip neigh
Listening ports and owners sudo ss -tulpn
Active connections ss -tn state established
DNS status and queries resolvectl status, resolvectl query example.com, dig +short example.com
Connectivity and path ping -c4 1.1.1.1, traceroute host, mtr -rw host
Throughput iperf3 -s on one host, iperf3 -c server on another
Packet capture sudo tcpdump -i enp0s3 -nn port 53
HTTP test curl -v https://example.com, curl -I, wget

6.3Netplan examples

DHCP:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true

Static IP with two DNS servers:

network:
  version: 2
  ethernets:
    enp0s3:
      dhcp4: false
      addresses: [192.168.56.20/24]
      routes:
        - to: default
          via: 192.168.56.1
      nameservers:
        addresses: [1.1.1.1, 9.9.9.9]
        search: [lab.local]

Bond, bridge and VLAN examples use bonds:, bridges: and vlans: sections (bridge needed for KVM guests). Wi-Fi uses wifis: with access-points.

Apply safely:

sudo chmod 600 /etc/netplan/*.yaml
sudo netplan generate        # syntax check
sudo netplan try             # applies, auto-reverts in 120 s unless confirmed
sudo netplan apply

NetworkManager: nmcli device status, nmcli connection show, nmcli connection add type ethernet ifname enp0s3 con-name lab ipv4.method manual ipv4.addresses 192.168.56.20/24 ipv4.gateway 192.168.56.1, nmcli connection up lab, nmtui.

Hostname and hosts file: hostnamectl set-hostname web01, /etc/hosts for static name mapping, /etc/hostname.

6.4DNS and DHCP services

  • Resolving: systemd-resolved caches and forwards; stub listener 127.0.0.53. Check which servers are used with resolvectl status. Flush with sudo resolvectl flush-caches.
  • Local DNS server options: bind9 (authoritative and recursive), unbound (recursive), dnsmasq (small DNS plus DHCP for labs).
sudo apt install dnsmasq
# /etc/dnsmasq.d/lab.conf
interface=enp0s8
dhcp-range=192.168.56.100,192.168.56.150,12h
dhcp-option=option:router,192.168.56.1
address=/web01.lab.local/192.168.56.20
  • Time: timedatectl timesync-status; for accuracy use chrony (sudo apt install chrony, chronyc tracking).

6.5Routing, NAT and forwarding

# make Ubuntu a simple router/NAT gateway
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-forward.conf
sudo sysctl --system
sudo nft add table ip nat
sudo nft 'add chain ip nat postrouting { type nat hook postrouting priority 100 ; }'
sudo nft add rule ip nat postrouting oifname "enp0s3" masquerade

Persist nftables rules in /etc/nftables.conf and enable nftables.service. For multiple tables or policy routing see ip rule and ip route add ... table N.

6.6Firewall with UFW and nftables

UFW is the simple front-end, backed by nftables.

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH                      # BEFORE enabling on a remote host
sudo ufw allow 80,443/tcp
sudo ufw allow from 192.168.56.0/24 to any port 5432 proto tcp
sudo ufw limit ssh                          # rate-limit brute force
sudo ufw logging medium
sudo ufw enable
sudo ufw status numbered ; sudo ufw delete 3

Application profiles live in /etc/ufw/applications.d/ (sudo ufw app list). For advanced rules inspect nftables directly: sudo nft list ruleset. Remember that Docker modifies firewall rules directly; published container ports can bypass UFW unless you manage the DOCKER-USER chain.

Firewall design checklist: default deny inbound, allow only required ports, restrict admin ports (SSH, databases) to management networks, log drops at low volume, test from another host with nmap.

6.7Secure Shell (SSH)

Server install and status: sudo apt install openssh-server, systemctl status ssh. Config: /etc/ssh/sshd_config and drop-ins in /etc/ssh/sshd_config.d/.

Keys instead of passwords

ssh-keygen -t ed25519 -a 100 -C "alice@laptop"      # on the client
ssh-copy-id -i ~/.ssh/id_ed25519.pub alice@192.168.56.20
ssh alice@192.168.56.20

Hardened server settings (file /etc/ssh/sshd_config.d/10-hardening.conf):

PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
AllowUsers alice bob
MaxAuthTries 3
LoginGraceTime 30
ClientAliveInterval 300
ClientAliveCountMax 2
X11Forwarding no

Validate and apply: sudo sshd -t && sudo systemctl reload ssh. Keep a second session open when testing. Changing the port gives small noise reduction only; real protection is keys, firewall, and fail2ban.

Client configuration ~/.ssh/config:

Host web01
    HostName 192.168.56.20
    User alice
    IdentityFile ~/.ssh/id_ed25519
    ProxyJump bastion

Useful features

Need Command
Copy files scp file host:/tmp/, rsync -avz -e ssh dir/ host:/srv/dir/, sftp host
Local port forward ssh -L 8080:localhost:80 host
Dynamic SOCKS proxy ssh -D 1080 host
Jump host ssh -J bastion web01
Agent forwarding (use sparingly) ssh -A host
Key fingerprints ssh-keygen -lf ~/.ssh/id_ed25519.pub, ssh-keyscan host
Audit server settings sudo sshd -T, ssh-audit host

fail2ban: sudo apt install fail2ban, create /etc/fail2ban/jail.local with [sshd] enabled = true, maxretry = 5, bantime = 1h; view with sudo fail2ban-client status sshd.

6.8Troubleshooting network problems

Work bottom-up: link, address, gateway, DNS, service.

  1. ip -br link / ethtool enp0s3: is the interface up with carrier?
  2. ip -br a: correct address and mask?
  3. ping <gateway>: local network working?
  4. ping 1.1.1.1: routing and NAT working?
  5. ping example.com / dig example.com: DNS working?
  6. ss -tulpn on the server: is the service listening on the right address and port?
  7. sudo ufw status / nft list ruleset: is a firewall blocking it?
  8. tcpdump: do packets arrive and are replies sent?

Hands-on Lab

Lab 6: network build and hardening

  1. Give ubu-server1 a static IP via Netplan; use netplan try and confirm the revert works when you deliberately break the config.
  2. Set up key-only SSH from ubu-desktop, harden sshd, and show a password login is refused.
  3. Configure UFW (default deny, allow SSH from the management subnet only, allow 80/443). Verify from another VM with nmap.
  4. Turn ubu-server2 into a router/NAT for a second subnet, or configure dnsmasq DHCP and DNS for a lab network.
  5. Install fail2ban and trigger a ban from a failed-login test, then unban.

Deliverable: configuration files, verification outputs, and a network diagram.

Unit Quiz

Unit 6 quiz

  1. Difference between Netplan, systemd-networkd and NetworkManager?
  2. Why use netplan try on a remote machine?
  3. List the order you troubleshoot a "cannot reach website" report.
  4. Why must you allow SSH before enabling UFW on a remote host?
  5. Name four settings that harden sshd.
  6. What does ssh -J do?

Unit 7

Security hardening, access control, auditing and compliance

Learning objectives: apply layered hardening to Ubuntu; use AppArmor, auditd and integrity tools; manage secrets and keys; measure and document compliance.

7.1Security principles

  • Least privilege: give each user and service only the access needed.
  • Defence in depth: firewall, authentication, patching, sandboxing, monitoring, backups: any one can fail.
  • Reduce attack surface: fewer packages, fewer open ports, fewer services.
  • Secure by default, verify by audit: configure, then measure.
  • Assume breach: log centrally, alert, and rehearse recovery.

7.2Hardening checklist (server)

Area Action Check
Patching Automatic security updates; reboot windows; Livepatch where licensed pro security-status, apt list --upgradable
Accounts No shared accounts; remove unused users; disable root SSH; strong password policy; MFA for admin awk -F: '$3==0' /etc/passwd, sudo passwd -S -a
Authentication Key-only SSH; PAM lockout (pam_faillock); password quality (libpam-pwquality) sshd -T, /etc/security/pwquality.conf
Network Default-deny firewall; close unused ports; restrict admin ports ss -tulpn, ufw status
Services Disable what you do not use systemctl list-unit-files --state=enabled
Filesystems nosuid,nodev,noexec on /tmp, /var/tmp, upload dirs; separate /var/log findmnt, /etc/fstab
Kernel sysctl hardening (below); keep Secure Boot enabled sysctl -a
MAC AppArmor enforcing sudo aa-status
Logging Persistent journal, central log host, time sync journalctl --disk-usage, timedatectl
Encryption Disk encryption on laptops, TLS everywhere, SSH keys with passphrases lsblk -f, testssl.sh
Backup Tested, offline/immutable copy Restore drill
Audit Run Lynis / USG regularly Compare scores over time

7.3Password and login policy with PAM

PAM modules live in /etc/pam.d/. Typical hardening:

sudo apt install libpam-pwquality
# /etc/security/pwquality.conf
minlen = 14
minclass = 3
retry = 3

# lockout after failures: /etc/security/faillock.conf
deny = 5
unlock_time = 900
fail_interval = 900

Show lock state with faillock --user alice, reset with faillock --user alice --reset. Set password ageing via chage and defaults in /etc/login.defs. Prefer SSH keys and MFA (for example libpam-google-authenticator or a FIDO2 security key via pam_u2f) for administrators.

7.4Kernel and network sysctl hardening

/etc/sysctl.d/99-hardening.conf:

net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
kernel.kptr_restrict = 2
kernel.dmesg_restrict = 1
kernel.randomize_va_space = 2
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
fs.suid_dumpable = 0

Apply with sudo sysctl --system. Ubuntu already enables many protections by default (ASLR, stack protector, PIE, restricted ptrace, unprivileged-user-namespace restrictions via AppArmor); verify rather than assume.

7.5AppArmor (mandatory access control)

AppArmor confines programs with profiles. Modes: enforce (block and log) and complain (log only).

sudo aa-status                                  # profiles and modes
sudo apt install apparmor-utils apparmor-profiles
sudo aa-complain /etc/apparmor.d/usr.sbin.nginx # learn mode
sudo aa-logprof                                  # update profile from logs
sudo aa-enforce  /etc/apparmor.d/usr.sbin.nginx
sudo apparmor_parser -r /etc/apparmor.d/profile  # reload
journalctl -k | grep -i apparmor                 # denials

Snap packages and many system services ship with profiles. Do not disable AppArmor to "fix" a problem; read the denial and adjust the profile. SELinux is available but not the Ubuntu default.

7.6Auditing and monitoring

auditd records security-relevant events:

sudo apt install auditd audispd-plugins
sudo auditctl -w /etc/passwd -p wa -k identity       # watch file writes/attribute changes
sudo auditctl -w /etc/sudoers.d/ -p wa -k sudoers
sudo auditctl -a always,exit -F arch=b64 -S execve -F euid=0 -k root-exec
sudo ausearch -k identity -i                         # query
sudo aureport --auth --summary

Persist rules in /etc/audit/rules.d/*.rules, then sudo augenrules --load.

File integrity: AIDE (sudo apt install aide, sudo aideinit, sudo aide --check) detects unexpected changes; store the database off the host.

Intrusion and abuse tools: fail2ban (log-based blocking), rkhunter and chkrootkit (rootkit checks, limited value), crowdsec (collaborative blocklists), Wazuh (HIDS/SIEM agent), osquery (query system state with SQL).

Central logging: forward with rsyslog (*.* @@loghost:514) or systemd-journal-remote, and retain logs outside the host so an intruder cannot erase them.

7.7Secrets and keys

  • Keep secrets out of scripts and Git. Use files with mode 600 owned by the service user, systemd LoadCredential=/EnvironmentFile=, or a secrets manager (Vault, cloud KMS).
  • SSH: passphrase-protected keys, ssh-agent, certificates for larger fleets, remove old keys from authorized_keys.
  • GPG basics: gpg --full-generate-key, gpg --encrypt -r id file, gpg --sign, keyserver and signature verification for downloads.
  • TLS: certificates with Let's Encrypt (certbot), automatic renewal (systemctl list-timers | grep certbot), strong protocols (TLS 1.2 and 1.3 only).

7.8Secure Boot, TPM and disk protection

  • Secure Boot is supported with Canonical-signed shim and kernels; third-party kernel modules need signing (MOK enrolment).
  • TPM-backed full-disk encryption (available in recent installers) ties disk unlock to measured boot state.
  • GRUB password protects boot edits on physical machines; BIOS/UEFI password and disabled USB boot for kiosks.

7.9Auditing with Lynis, Ubuntu Security Guide and OpenSCAP

sudo apt install lynis
sudo lynis audit system                     # report in /var/log/lynis-report.dat
sudo lynis show details TEST-ID             # explanation of one test

# via Ubuntu Pro (CIS / DISA-STIG profiles)
sudo pro enable usg
sudo apt install usg
sudo usg audit cis_level1_server
sudo usg fix cis_level1_server              # applies changes; test on staging first

Treat the hardening index as a trend, not a goal: some controls conflict with application needs. Document every accepted exception with reason and owner.

7.10Incident response basics on Ubuntu

  1. Detect: unusual logins (last, lastb, journalctl -u ssh), new users, processes, cron entries, listening ports, modified binaries (debsums -c).
  2. Contain: isolate from network (firewall rule or disconnect), preserve volatile evidence if needed.
  3. Eradicate: rebuild from known-good, rotate all credentials and keys.
  4. Recover: restore data from clean backup, patch the entry point, monitor closely.
  5. Learn: write a timeline, root cause, and fixes.

Hands-on Lab

Lab 7: harden and audit

  1. Baseline: run lynis audit system on a fresh server; note the hardening index and top 10 suggestions.
  2. Apply: PAM password policy and lockout, sysctl file, key-only SSH, UFW, fail2ban, noexec,nosuid on /tmp.
  3. Put one service (nginx) in AppArmor complain mode, trigger denials, adjust the profile, and enforce it.
  4. Add auditd rules for /etc/passwd, /etc/sudoers.d/ and root commands; generate and find events.
  5. Initialise AIDE, change a file, and detect it.
  6. Re-run Lynis and compare scores; document two exceptions you chose not to fix and why.

Deliverable: before/after audit summary and your hardening standard (one page).

Unit Quiz

Unit 7 quiz

  1. What is the difference between AppArmor enforce and complain modes?
  2. Why store logs on a separate host?
  3. Name five items in a server hardening checklist.
  4. What does auditctl -w /etc/passwd -p wa -k identity do?
  5. Why should a hardening score be treated as a trend rather than a target?

Unit 8

Shell scripting and automation

Learning objectives: write robust, safe Bash scripts; use systemd timers, cloud-init and Ansible to automate repeated work; know when to move from Bash to Python.

8.1Script structure and safe defaults

#!/usr/bin/env bash
set -Eeuo pipefail
trap 'echo "Error on line $LINENO" >&2' ERR
IFS=$'\n\t'

usage() { echo "Usage: $0 [-v] <target>" >&2; exit 1; }

verbose=0
while getopts ":v" opt; do
  case "$opt" in
    v) verbose=1 ;;
    *) usage ;;
  esac
done
shift $((OPTIND - 1))
[ $# -eq 1 ] || usage
target="$1"

set -e stops on error, -u on unset variables, -o pipefail makes a pipeline fail if any stage fails. trap ... ERR and trap ... EXIT run cleanup even on failure.

8.2Variables, parameters, arrays

Concept Example
Positional parameters $0 script, $1.. args, $# count, $@/$* all args, $? last exit code, $$ PID
Default/alternate values ${name:-default}, ${name:=default}, ${name:?error message}
String ops ${var#prefix}, ${var%suffix}, ${var/old/new}, ${#var} length
Arrays hosts=(web1 web2 web3), ${hosts[@]}, ${#hosts[@]}, for h in "${hosts[@]}"; do ...; done
Associative arrays declare -A conf=( [host]=web1 [port]=8080 ), ${conf[host]}
Arithmetic (( i++ )), result=$(( a * b )), ((x > 10)) && echo big

8.3Control flow

if [[ -f "$file" && -r "$file" ]]; then
  echo "readable"
elif [[ -d "$file" ]]; then
  echo "directory"
else
  echo "missing"
fi

for f in *.log; do [[ -e "$f" ]] || continue; gzip "$f"; done

while IFS=, read -r name ip; do
  ping -c1 -W1 "$ip" >/dev/null && echo "$name up" || echo "$name down"
done < hosts.csv

case "$1" in
  start) systemctl start myapp ;;
  stop)  systemctl stop myapp ;;
  *)     usage ;;
esac

8.4Functions and modular scripts

log() { printf '%s %s\n' "$(date '+%F %T')" "$*" >&2; }
retry() {
  local -i attempts=$1; shift
  until "$@"; do
    (( --attempts <= 0 )) && return 1
    log "retrying: $*"
    sleep 2
  done
}

retry 3 curl -fsS https://example.com/health

Split large scripts into functions, and large projects into sourced library files (source lib/common.sh). Use local inside functions to avoid leaking variables.

8.5Worked example: health-check and alert script

#!/usr/bin/env bash
set -Eeuo pipefail

hosts=(web01 web02 db01)
failed=()

for h in "${hosts[@]}"; do
  if ! ssh -o ConnectTimeout=3 -o BatchMode=yes "$h" true 2>/dev/null; then
    failed+=("$h")
  fi
done

if (( ${#failed[@]} > 0 )); then
  echo "DOWN: ${failed[*]}" | mail -s "Health check alert" ops@example.com
  exit 1
fi
echo "All hosts reachable"

8.6Scheduling scripts

# crontab -e
*/5 * * * * /usr/local/bin/healthcheck.sh >> /var/log/healthcheck.log 2>&1

For logging, retries and dependency ordering prefer a systemd service plus timer (Unit 4). Use flock to prevent overlapping runs: flock -n /tmp/healthcheck.lock /usr/local/bin/healthcheck.sh.

8.7Testing and quality

  • Lint every script: sudo apt install shellcheck && shellcheck script.sh.
  • Format consistently with shfmt.
  • Test destructive scripts with --dry-run flags and set -n (syntax check only) before running for real.
  • Keep scripts in Git; tag releases; write a short README per script (purpose, usage, exit codes).

8.8Common pitfalls and how to avoid them

Pitfall Fix
Unquoted variables (rm -rf $dir/* when $dir is empty) Always quote: "$dir"; validate inputs before using them
Parsing ls output Use globs or find -print0 with read -d ''
Using [ instead of [[ for complex tests Prefer [[ ... ]] in Bash
Ignoring exit codes Check $? or use set -e and explicit handling
Secrets hardcoded in scripts Read from environment or a secrets manager
No logging Log start, end, and errors with timestamps

8.9Python as the next step

When a script needs data structures, APIs, or real error handling, move to Python 3 (preinstalled). Use argparse for options, subprocess.run for commands, logging for structured logs, and a virtual environment (python3 -m venv venv) for dependencies.

8.10Configuration management and provisioning

  • cloud-init: first-boot configuration for cloud images, VMs and WSL; a user-data file can create users, run commands, write files and install packages on first boot. Useful for reproducible lab VMs.
  • Ansible: agentless, over SSH. Install with sudo apt install ansible. An inventory (hosts.ini) lists servers; a playbook (YAML) describes desired state.
# site.yml
- hosts: webservers
  become: true
  tasks:
    - name: install nginx
      apt:
        name: nginx
        state: present
        update_cache: true
    - name: ensure nginx is running
      service:
        name: nginx
        state: started
        enabled: true

Run with ansible-playbook -i hosts.ini site.yml --check (dry run) then without --check. Idempotency (safe to run repeatedly) is the key design goal.

  • Make/Just: simple task runners for repeatable local commands (make deploy, just build).

Hands-on Lab

Lab 8: automation toolkit

  1. Write sysinfo.sh: hostname, kernel, uptime, memory and disk use, top 3 processes by memory; add a --json flag.
  2. Write healthcheck.sh as shown, extend it to check an HTTP endpoint with curl -fsS, and schedule it with a systemd timer, with flock protection.
  3. Lint both scripts with ShellCheck and fix every warning.
  4. Write an Ansible playbook that installs and starts Nginx on ubu-server2, and run it twice to show idempotency.
  5. Write a cloud-init user-data file that creates a user, installs htop and curl, and prints "ready" on first boot; test it with a fresh VM if your hypervisor supports cloud-init (or multipass).

Deliverable: scripts, playbook, cloud-init file, and ShellCheck output with zero warnings.

Unit Quiz

Unit 8 quiz

  1. What do set -e, -u and -o pipefail each protect against?
  2. Why quote "$var" in almost every case?
  3. What problem does flock solve for scheduled scripts?
  4. What makes an Ansible playbook idempotent, and why does that matter?
  5. When should you stop writing Bash and move to Python?

Unit 9

Server services, containers, virtualisation and monitoring

Learning objectives: deploy and secure web and database services; run and manage containers; understand virtualisation choices; monitor and log a fleet of servers.

9.1Web servers

Nginx

sudo apt install nginx
sudo systemctl enable --now nginx
sudo ufw allow 'Nginx Full'
# /etc/nginx/sites-available/example.conf
server {
    listen 80;
    server_name example.lab;
    root /var/www/example;
    index index.html;
    location / { try_files $uri $uri/ =404; }
}
sudo ln -s /etc/nginx/sites-available/example.conf /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Apache alternative: sudo apt install apache2, sites in /etc/apache2/sites-available/, sudo a2ensite example, sudo a2enmod ssl rewrite, apachectl configtest.

TLS with Let's Encrypt

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.lab --redirect
sudo systemctl list-timers | grep certbot   # auto-renewal

Logs: /var/log/nginx/access.log and error.log (or /var/log/apache2/). Rotate with logrotate (/etc/logrotate.d/nginx).

9.2Databases

PostgreSQL

sudo apt install postgresql
sudo -u postgres psql -c "CREATE USER appuser WITH PASSWORD 'change-me';"
sudo -u postgres psql -c "CREATE DATABASE appdb OWNER appuser;"
# listen only on localhost unless remote access is required:
# postgresql.conf: listen_addresses = 'localhost'
# pg_hba.conf: restrict by IP and require scram-sha-256

MariaDB/MySQL

sudo apt install mariadb-server
sudo mysql_secure_installation
sudo mysql -e "CREATE DATABASE appdb; CREATE USER 'app'@'localhost' IDENTIFIED BY 'change-me'; GRANT ALL ON appdb.* TO 'app'@'localhost';"

Back up with pg_dump -Fc appdb > appdb.dump / mariadb-dump --single-transaction appdb > appdb.sql; never expose database ports to the internet directly.

9.3Containers with Docker

# install (Docker's own repo keeps current; Ubuntu's docker.io is simpler for labs)
sudo apt install docker.io docker-compose-plugin
sudo usermod -aG docker "$USER"   # log out/in to apply

docker run -d --name web -p 8080:80 nginx:stable
docker ps ; docker logs -f web ; docker exec -it web sh
docker stop web ; docker rm web
docker image ls ; docker system prune -a   # remove unused images/containers

Compose (docker-compose.yml):

services:
  web:
    image: nginx:stable
    ports: ["8080:80"]
    volumes: ["./site:/usr/share/nginx/html:ro"]
    restart: unless-stopped
  db:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: change-me
    volumes: ["dbdata:/var/lib/postgresql/data"]
volumes:
  dbdata:

docker compose up -d, docker compose logs -f, docker compose down.

Container security basics: run as non-root inside the image, use official or scanned images, scan with trivy image nginx:stable, drop capabilities (--cap-drop ALL --cap-add NET_BIND_SERVICE), set resource limits (--memory, --cpus), and keep the Docker daemon socket off the network. Remember UFW does not see Docker's published ports by default; manage the DOCKER-USER iptables/nftables chain if you need to restrict them.

Podman is a daemonless, rootless alternative with a compatible CLI: sudo apt install podman, podman run -d -p 8080:80 nginx. Good where root-level daemons are unwanted.

9.4Virtualisation

Technology Use
KVM/QEMU + libvirt Full virtual machines on Linux; virt-manager GUI or virsh CLI
LXD/Incus System containers that feel like lightweight VMs
VirtualBox/VMware Desktop hypervisors for labs (this course's primary tool)
Multipass Quick disposable Ubuntu VMs for development
sudo apt install qemu-kvm libvirt-daemon-system virtinst virt-manager
virsh list --all
virt-install --name test --memory 2048 --vcpus 2 --disk size=20 --cdrom ubuntu-26.04.iso

9.5Monitoring and observability

Layer Tools
Quick local view htop, glances, iotop, nethogs, dstat
Metrics collection node_exporter (Prometheus), netdata (instant dashboard, low setup)
Metrics storage and dashboards Prometheus + Grafana
Logs journalctl, centralised with rsyslog/systemd-journal-remote, or the ELK/Grafana Loki stack
Alerting Prometheus Alertmanager, Grafana alerts, simple mail/webhook scripts
Fleet management Landscape (Canonical, via Ubuntu Pro), Ansible for configuration drift checks

Minimal Prometheus + node_exporter + Grafana on one VM (concept): install node_exporter on each server, point Prometheus's prometheus.yml scrape config at them, run Grafana and add Prometheus as a data source, import a standard "Node Exporter Full" dashboard.

sudo apt install prometheus prometheus-node-exporter grafana
sudo systemctl enable --now prometheus prometheus-node-exporter grafana-server
# Grafana UI on :3000, Prometheus on :9090

9.6Log rotation and housekeeping

cat /etc/logrotate.d/nginx          # see rotation rules for a service
sudo logrotate -f /etc/logrotate.conf   # force run (testing)
sudo journalctl --vacuum-time=30d   # cap journal retention

9.7Putting it together: a small production-style stack

Internet --> UFW (80/443 only) --> Nginx (reverse proxy, TLS via certbot)
                                       |
                                 app container (Docker)
                                       |
                                 PostgreSQL (localhost only)
Backups: nightly restic to a second disk and an off-site target
Monitoring: node_exporter -> Prometheus -> Grafana; journald -> central log host

Hands-on Lab

Lab 9: LEMP-plus-containers mini production stack

  1. Deploy Nginx as a reverse proxy in front of a containerised app (any simple web app image) with TLS via certbot (self-signed is fine in the lab).
  2. Run PostgreSQL in a container with a named volume; take a pg_dump backup and restore it into a fresh container to prove it works.
  3. Install node_exporter on the server and Prometheus plus Grafana on a second VM; show CPU and memory graphs for the server.
  4. Add a UFW rule set that only exposes 80/443/22, and confirm Docker's published ports are not silently open to the world.
  5. Configure logrotate for your application logs and force a rotation.

Deliverable: architecture diagram, configuration files, and screenshots of the Grafana dashboard.

Unit Quiz

Unit 9 quiz

  1. Why keep database ports bound to localhost when the application runs on the same host?
  2. What problem does --cap-drop ALL --cap-add NET_BIND_SERVICE solve for a container?
  3. Why can UFW rules fail to restrict a Docker container's published port?
  4. Name two things Podman offers that plain Docker does not by default.
  5. What are the three main layers of a monitoring stack (collection, storage, visualisation) and name one tool for each?

Unit 10

Troubleshooting, capstone project, cheat sheet and references

Learning objectives: apply a systematic troubleshooting method; complete an end-to-end build-secure-operate capstone; use the quick-reference material for daily work.

10.1A systematic troubleshooting method

  1. Define the problem precisely. What is expected, what happens, when did it start, what changed.
  2. Reproduce it if possible; note exact steps.
  3. Check the obvious first: power, cables/links, disk space, recent changes, service status.
  4. Isolate the layer: hardware, kernel, service, application, network, DNS (Unit 6's bottom-up method applies generally).
  5. Check logs: journalctl -xe, the relevant service log, dmesg.
  6. Form a hypothesis, test it, change one thing at a time.
  7. Fix, verify the fix, document what happened and why, and whether monitoring should have caught it sooner.

10.2Common problems and first commands

Symptom Start here
Server unreachable ping, ip -br a, ip route, check hypervisor console, check cabling/VM network adapter
Service down systemctl status svc, journalctl -u svc -n 100, config test (nginx -t, sshd -t)
Disk full df -h, `du -sh /var/*
High load top/htop, uptime, vmstat 1, iostat -xz 1, check for runaway cron jobs
Cannot SSH in Console access, check sshd status and config, firewall, fail2ban ban list, disk full (auth fails silently if / is full)
DNS failures resolvectl status, dig, check /etc/resolv.conf and Netplan nameservers
Package/update errors sudo apt --fix-broken install, dpkg --configure -a, check held packages, disk space
Boot failure GRUB menu, recovery mode, check /etc/fstab for a bad entry, journalctl -b -1 after recovery
Permission denied ls -l, id, getfacl, sudo -l, AppArmor denials (`journalctl -k
Slow network mtr, iperf3, check duplex/speed (ethtool), check for saturated links

10.3Building a personal runbook

For each recurring task at work (deploying a service, rotating a certificate, onboarding a user), write a short runbook: trigger, prerequisites, steps, verification, rollback. Store runbooks in Git alongside your Ansible playbooks and scripts.

10.4Capstone project

Design, build, secure and operate a small two-tier application on Ubuntu Server, end to end.

Phase Deliverable
Design Architecture diagram: web tier, app/container tier, database, backup target, monitoring host
Build Netplan networking, Nginx reverse proxy with TLS, a containerised app, PostgreSQL or MariaDB
Automate An Ansible playbook that can rebuild the stack from scratch (idempotent)
Secure UFW default-deny, key-only SSH, fail2ban, AppArmor enforcing for custom services, sysctl hardening, Lynis baseline
Operate restic backups with a tested restore, node_exporter + Prometheus + Grafana dashboard, log rotation
Validate Simulate a disk-full event, a failed service, and a restore from backup; document the recovery
Document A short runbook and a one-page architecture summary

10.5Command-line cheat sheet

Category Commands
System info uname -r, lsb_release -a, hostnamectl, uptime, free -h, df -h
Users adduser, usermod -aG group user, passwd, chage -l, sudo visudo
Permissions chmod, chown, umask, setfacl/getfacl
Processes ps aux, top/htop, kill -9 PID, systemctl status/start/stop/enable
Packages apt update/upgrade/install/remove/autoremove, dpkg -L/-S, snap list/install/refresh
Networking ip -br a, ip route, ss -tulpn, dig, curl -I, nmap -sn
Firewall/SSH ufw allow/enable/status, ssh-keygen, ssh-copy-id, sshd -t
Storage lsblk -f, df -h, mount -a, lvcreate/lvextend, mdadm --detail
Logs journalctl -u svc -f, journalctl -b, journalctl -p err
Backups restic backup/snapshots/restore, rsync -aHAX
Scripting set -euo pipefail, shellcheck, crontab -e, systemctl list-timers

10.6Exam-style question bank (sample, answers not included)

  1. Explain the difference between apt upgrade and apt full-upgrade, and give a situation where each is correct.
  2. A web server returns 502 Bad Gateway. List, in order, the checks you would run.
  3. Design a permission scheme (ownership, mode, ACLs) for a shared folder used by two teams with different access levels.
  4. Write a systemd unit and timer that runs a backup script nightly, restarts on failure, and does not run if the previous run is still active.
  5. A disk is at 100% and the server is unresponsive over SSH but the console works. Walk through your recovery steps.
  6. Compare LVM snapshots, Btrfs/ZFS snapshots and restic backups: what each protects against and what it does not.
  7. You must expose a web app on 443 only, keep SSH limited to a management subnet, and allow outbound updates. Write the UFW/nftables rules.
  8. Explain how you would migrate a stateful application from a single VM to a container without data loss.
  9. A junior admin disabled AppArmor to "fix" an error. Explain why this is the wrong fix and what you would do instead.
  10. Outline a complete disaster-recovery test plan for a small server estate.

10.7References and further study

  • Ubuntu documentation and release notes
  • Ubuntu Server Guide
  • The Linux Command Line by William Shotts (free; linuxcommand.org)
  • Netplan documentation (netplan.io), systemd documentation (man systemd, freedesktop.org/wiki/Software/systemd)
  • Ansible documentation (docs.ansible.com)
  • CIS Benchmarks for Ubuntu Linux
  • Certification study guides: LPIC-1, CompTIA Linux+, Linux Foundation Certified System Administrator (LFCS)

Self-Check

Final self-assessment

  • I can install Ubuntu Desktop and Server and complete first-boot hardening.
  • I can manage packages, repositories and updates, including Ubuntu Pro features.
  • I can administer users, permissions, processes and systemd services confidently.
  • I can design storage with LVM/RAID, encrypt volumes, and run tested backups.
  • I can configure networking, a default-deny firewall, and hardened SSH.
  • I can apply a layered hardening standard and audit it with Lynis/USG.
  • I can write safe, linted Bash scripts and automate with systemd timers and Ansible.
  • I can deploy and monitor web, database and container services.
  • I can troubleshoot systematically and document the fix.
  • I completed the capstone build-secure-operate project end to end.

This completes the Ubuntu Linux Administration course. For offensive security testing of the systems you now know how to build and defend, continue with the companion course, Kali Linux and Ethical Hacking.

Finished the units? Test yourself.

Take the three-stage practice exam (Beginner, Intermediate, Expert), and revise any unit you missed.