Linux Administration (RHCSA-style)
Run, secure and fix Linux servers from the command line.
A hands-on path through everyday Linux administration, aligned with the RHCSA objectives and equally useful on Ubuntu. You learn the shell, permissions, users, packages, systemd, storage with LVM, networking, SSH, SELinux, scheduling, troubleshooting, backups and Podman containers, then prove it by provisioning and hardening a server and solving timed exam-style tasks.
01Shell & essential tools
Get comfortable and fast at the command line.
- Lab setup, getting help & vimYou learn administration by breaking and fixing real systems, so start with two virtual machines: a RHEL-compatible one such as Rocky or AlmaLinux, and Ubuntu Server. Snapshots let you experiment without fear. The RHCSA gives you no internet, so you must get answers from man pages and --help, and edit files quickly in vim.10 min
- Navigating the file system hierarchyLinux has one directory tree starting at /, and the Filesystem Hierarchy Standard says what goes where. Knowing that configuration is in /etc, variable data in /var and user files in /home tells you where to look for almost anything. Tab completion, history and globbing make you fast.9 min
- Text processing: grep, sed, awk, sort, cutMost administration is reading text: logs, config files and command output. grep finds lines, sed edits them, awk and cut pull out columns, and sort and uniq summarise. Chained with pipes they answer questions like which IPs failed SSH logins most often in seconds.10 min
- Redirection, pipes & the shell environmentEvery process has three standard streams: stdin (0), stdout (1) and stderr (2). The shell can redirect them to files or connect one command's output to another's input with a pipe. Environment variables and startup files such as .bashrc shape how every command you run behaves.10 min
02Files, permissions & ACLs
Control who can read, change and run what.
- Files, links & findcp, mv, rm and ln are daily tools, and find is how you locate files by name, size, owner, permissions or age anywhere on the system. find can also act on what it finds, which makes it a frequent RHCSA task, such as copying all files owned by a user into a directory.11 min
- Permissions, ownership & umaskEvery file has an owner, a group and three sets of read, write and execute permissions for the user, the group and everyone else. chmod changes them using symbolic (u+x) or octal (750) notation, chown changes ownership and umask sets defaults for new files. Getting these right is the first line of defence on any server.10 min
- SUID, SGID & the sticky bitThree extra permission bits change how files and directories behave. SUID runs a program with its owner's privileges, SGID on a directory makes new files inherit the directory's group, and the sticky bit stops users from deleting each other's files in a shared directory. SGID plus a group is the standard answer for team collaboration directories.11 min
- Access control listsStandard permissions allow only one owner and one group. Access control lists add entries for extra named users and groups, and default ACLs on a directory are inherited by new files. A plus sign at the end of ls -l output tells you a file has an ACL.10 min
03Users, groups & sudo
Manage accounts and delegate privileges safely.
- Users, groups & password policyLinux identifies users and groups by numeric IDs stored in a few plain-text files. useradd, usermod and groupadd edit them safely, passwd sets passwords, and chage controls password aging. Supplementary groups are how you grant a user access to shared resources.11 min
- sudo & privilege delegationsudo lets approved users run commands as root or another user, with every use logged. Rules live in /etc/sudoers and, preferably, small drop-in files in /etc/sudoers.d edited with visudo, which checks syntax before saving. On RHEL members of wheel get full sudo; on Ubuntu it is the sudo group.10 min
04Package management
Install, update and trust software on RHEL and Debian families.
- dnf, rpm & repositoriesOn RHEL-family systems, rpm installs and queries individual package files, while dnf resolves dependencies and fetches packages from repositories. Repositories are defined by .repo files and signed with GPG keys so you only install trusted software. dnf history lets you see and undo transactions.10 min
- apt & dpkg on UbuntuDebian and Ubuntu use dpkg for individual .deb packages and apt for repositories and dependencies. apt update refreshes package indexes and apt upgrade installs newer versions. Third-party sources go in /etc/apt/sources.list.d with their own signing key.9 min
05Processes, services & logs
Control what runs, when it starts and why it failed.
- Processes, signals & prioritiesEvery running program is a process with a PID, an owner and a parent. ps and top show what is running and how much CPU and memory it uses, kill sends signals to stop or reload processes, and nice and renice change scheduling priority. Shell job control moves commands between foreground and background.11 min
- Managing services with systemctlsystemd is PID 1: it starts services, mounts, sockets and timers, all described as units. systemctl starts and stops units now, enables or disables them at boot, and shows their status with recent log lines. Masking a unit stops anything from starting it.10 min
- Writing & overriding unit filesUnits are plain INI-style files. Vendor units ship in /usr/lib/systemd/system and should never be edited; instead you override them with drop-in files in /etc/systemd/system, which systemctl edit creates for you. After changing any unit file, run systemctl daemon-reload.9 min
- Logs with journalctl & rsyslogsystemd-journald collects logs from the kernel, services and syslog into a structured, indexed journal. journalctl filters it by unit, priority, time or boot. By default on RHEL the journal may be volatile, so you configure persistent storage to keep logs across reboots, while rsyslog can still write classic files like /var/log/messages.10 min
- Boot process, targets & root recoveryBooting goes from firmware to the GRUB2 boot loader, to the kernel and initramfs, and then to systemd, which brings the system up to the default target. Targets such as multi-user and graphical replace the old runlevels. Knowing how to interrupt the boot lets you reach rescue mode or reset a lost root password, a classic RHCSA task.10 min
06Storage
Disks, partitions, LVM, file systems and network mounts.
- Disks & partitionsBefore a disk can hold file systems or LVM it is usually divided into partitions recorded in a partition table. GPT is the modern standard and supports large disks and many partitions; MBR is the legacy format. lsblk shows the layout and fdisk, gdisk or parted change it.11 min
- Creating file systems: ext4 & xfsA file system organises a partition or logical volume into files and directories. RHEL defaults to xfs and Ubuntu to ext4; both are journaling file systems. You create them with mkfs, identify them by UUID or label, and grow them when the underlying device grows.11 min
- Mounting, /etc/fstab & swapMounting attaches a file system to a directory. Manual mounts vanish at reboot, so persistent mounts go in /etc/fstab, preferably by UUID because device names can change. Swap space is added the same way and gives the kernel somewhere to move idle memory pages.10 min
- LVM: physical volumes, volume groups & logical volumesLVM puts a flexible layer between disks and file systems. Physical volumes are pooled into a volume group, and logical volumes are carved from that pool and can be grown, or for some file systems shrunk, without repartitioning. It is the standard way to manage server storage and a large part of the RHCSA.10 min
- NFS clients & autofsNFS lets a client mount directories exported by a file server over the network. You can mount them manually, persistently in fstab, or on demand with autofs, which mounts a share when someone accesses it and unmounts it after it sits idle. Automounted home directories are a classic RHCSA task.10 min
07Networking
Addresses, routes, names and firewalls.
- IP addressing, routes & socketsEvery host needs an IP address with a prefix, a default gateway and DNS servers to reach the world. The ip command shows interfaces, addresses and routes, ss shows which ports are listening and connected, and ping, tracepath and curl test reachability layer by layer.10 min
- NetworkManager & nmcliOn RHEL, NetworkManager owns network configuration and nmcli is its command-line interface. Settings live in connection profiles attached to devices, so you modify a profile and bring it up to apply changes persistently. Ubuntu Server uses netplan, which can drive NetworkManager or systemd-networkd.9 min
- Hostnames, DNS resolution & time syncNames are resolved in the order set by /etc/nsswitch.conf, usually /etc/hosts first and then DNS servers from /etc/resolv.conf. hostnamectl sets the machine's own name persistently. Accurate time matters for logs, TLS and Kerberos, so chronyd keeps the clock synchronised with NTP servers.9 min
- firewalld & ufwA host firewall allows only the traffic your services need. On RHEL, firewalld organises rules into zones and uses predefined services such as http and ssh; on Ubuntu, ufw offers a simpler front end. Both sit on top of nftables in the kernel.10 min
08SSH & mandatory access control
Secure remote access, then confine services with SELinux or AppArmor.
- SSH & key-based authenticationSSH gives you an encrypted remote shell and file transfer. With key-based authentication, the server stores your public key and you prove you hold the matching private key, so no password crosses the network. A ~/.ssh/config file saves typing for hosts you use often.11 min
- Hardening sshdInternet-facing SSH servers are attacked constantly. Disabling root and password logins, restricting which users may connect and rate-limiting failed attempts removes most of the risk. Always validate the config and test from a second session before closing your current one.10 min
- SELinux basicsSELinux adds mandatory access control on top of normal permissions: every process and file has a security context, and policy decides which process types may touch which file types. Most problems come from wrong file labels, a disabled boolean or a non-standard port. The fix is to correct the label or policy setting, never to disable SELinux.11 min
- AppArmor basics on UbuntuAppArmor is the mandatory access control system on Ubuntu and SUSE. Instead of labels, it confines programs with path-based profiles that list which files and capabilities each may use. Profiles run in enforce mode, which blocks violations, or complain mode, which only logs them.9 min
09Scheduling & shell scripting
Make the machine do routine work for you.
- cron & atcron runs commands on a repeating schedule defined by five time fields, and at runs a command once at a given time. Users manage their own jobs with crontab -e, while system jobs go in /etc/cron.d. Output that is not redirected is mailed to the owner or lost, so log it deliberately.11 min
- systemd timerssystemd timers are the modern alternative to cron. A timer unit decides when to run and activates a matching service unit that does the work, so you get journald logging, dependencies, resource limits and catch-up for missed runs with Persistent=true.9 min
- Bash scripting fundamentalsBash scripts turn command sequences into repeatable tools. A robust script starts with a shebang and strict mode, checks its arguments, quotes every variable, uses functions for structure and returns meaningful exit codes. The RHCSA expects simple scripts with loops, conditionals and arguments.11 min
- Scripts for real admin tasksGood admin scripts are idempotent: running them twice leaves the system in the same state as running them once. They check before changing, log what they did and fail loudly. Typical examples are bulk user creation, disk space alerts and daily health reports.10 min
10Monitoring, backups & containers
Keep systems healthy, recoverable and running modern workloads.
- Performance: top, vmstat, iostat & freeWhen a server is slow, the first job is to find which resource is saturated: CPU, memory, disk I/O or network. top shows load and the busiest processes, free shows memory, vmstat shows run queues, swapping and I/O wait over time, and iostat shows per-disk utilisation and latency.11 min
- A troubleshooting methodGood troubleshooting is a method, not luck. Start from a precise symptom, ask what changed, gather evidence from status, logs and resource checks, form one hypothesis at a time, test it, and record the root cause. Most real incidents are a failed service, a full disk, a bad config, DNS or a firewall or SELinux rule.11 min
- Backups & archiving with tar and rsynctar bundles files into an archive, optionally compressed with gzip, bzip2 or xz, and preserves permissions. rsync copies only what changed, locally or over SSH, which makes it ideal for regular backups. A backup only counts once you have restored from it successfully.10 min
- Containers with PodmanPodman runs OCI containers without a central daemon and can run them rootless as a normal user. Its commands mirror Docker's: pull images, run containers with published ports and environment variables, and mount host directories for persistent data. On SELinux systems the :Z volume option relabels host directories so containers can use them.10 min
- Running containers as systemd servicesContainers should start at boot like any other service. Quadlet lets you describe a container in a small .container file, and systemd generates a matching service unit from it. For rootless containers, lingering keeps the user's systemd instance running without a login session.8 min
11Capstone & timed practice
Build a server end to end, then practise under exam conditions.
- Provision a server end to endBring everything together by turning a fresh VM into a useful server, such as a web server with its content on LVM and a nightly backup. Work in a sensible order: identity and network first, then accounts, storage, software, services and scheduling. Keep notes of every command so you could rebuild it from a script.11 min
- Harden and verify the serverHardening means reducing what an attacker can reach and what they can do once inside. Layer controls: a tight firewall, key-only SSH for a limited group, least-privilege sudo, SELinux enforcing, automatic security updates and regular audits. Verify each control from another machine rather than assuming it works.10 min
- Timed RHCSA-style practice tasksThe RHCSA is a timed, hands-on exam: you get a list of tasks on real machines and everything is checked after a reboot. Practise full task sets under a timer, starting with anything that blocks other work, such as resetting root or fixing networking. Speed comes from repetition; correctness comes from verifying and rebooting.11 min