Linux
Learn Linux from the administrator's seat: the kernel and distributions, boot, users and access control, packages, systemd and logs, processes and memory, storage, networking, security hardening, and performance work.
What Linux is: the kernel and the distributionWhy "Linux" names three different things: a kernel, the userland built around it, and the distribution that packages both into a system you can install.Distributions and release modelsDebian, Ubuntu, the RHEL family, Arch and Alpine compared by how they release and how long they are supported, and how to pick one for a server.Getting a Linux machine to practice onA local VM, WSL2, a cloud instance or a container shell: what each one gives you, what it hides, and why snapshots make breaking things cheap.The filesystem hierarchyWhy Linux puts files where it does: /usr for the OS, /etc for config, /var for state, /run for runtime, the merged /usr, and why /tmp is now often RAM.Kernel space, user space and system callsThe privilege boundary every Linux program crosses, how system calls work under the C library, why some skip the kernel via the vDSO, and whose bug it is.From firmware to bootloader: UEFI and GRUBWhat happens between power-on and the kernel: BIOS versus UEFI, the EFI system partition, Secure Boot with shim, regenerating GRUB's config, and systemd-boot.The kernel command line and initramfsHow the bootloader passes parameters to the kernel, how to read and change them, and how the initramfs finds and mounts the real root filesystem.systemd as PID 1 and boot targetsWhat the first process does, how systemd targets replaced runlevels, how to choose the default target, reach rescue or emergency mode, and find slow boots.Kernel modules and driversHow Linux loads drivers as modules on demand: lsmod, modinfo and modprobe, module options, why blacklisting is weaker than it sounds, and DKMS.udev and device filesWhat a device file is, what major and minor numbers mean, how udev reacts to hardware events, and why you should mount disks by UUID, not /dev/sdb./proc, /sys and tuning with sysctlThe kernel's /proc and /sys as a live interface, how sysctl reads and writes /proc/sys, how sysctl.d makes changes stick, and a few knobs worth knowing.Users, groups and the account filesHow Linux identifies users and groups by number, what /etc/passwd, /etc/shadow and /etc/group hold, system versus human accounts, and NSS lookups.Managing accounts and passwordsCreating, changing, locking and removing accounts with useradd, usermod, passwd and chage, and the defaults in /etc/login.defs and /etc/skel behind them.sudo and the sudoers fileWhy admins use sudo instead of logging in as root, how sudoers rules are written and checked with visudo, drop-ins in /etc/sudoers.d, and rules that leak root.Special permission bits and umasksetuid, setgid and the sticky bit: how passwd edits a root-owned file, how shared directories keep their group, why /tmp is safe, and what umask does.Access control listsPOSIX ACLs for when owner, group and other are not enough: getfacl and setfacl, the mask that quietly limits them, default ACLs, and when a group is simpler.PAM and the login pathHow Linux checks a password: PAM's four module types, the stacks in /etc/pam.d, what required, requisite and sufficient do, and what runs before a shell.Packages, repositories and dependenciesWhat a package contains, how a repository's signed index ties every file to a checksum, how dependencies are resolved, and why curl | sh is a step back.apt and dpkgDebian and Ubuntu package management: dpkg underneath, apt on top, upgrade versus full-upgrade, holds and apt-cache policy, finding files, and deb822 sources.dnf and rpmPackage management on Fedora, RHEL, Rocky and Alma: rpm queries, dnf on top, where repo files live now, undoing a transaction, and what became of modules.Third-party repositories and signing keysHow package signatures are checked, why apt-key is gone and signed-by replaced it, adding a vendor repository safely, pinning priorities, and EPEL and PPAs.Snap, Flatpak and AppImageThe bundled, sandboxed package formats: what each ships, how they update and confine apps, and why they suit desktops better than servers, with exceptions.Shared libraries and building from sourceHow the dynamic linker finds shared libraries, what sonames are for, ldd and ldconfig, and how to build software from source without making a mess of /usr.Units, targets and dependenciesWhat a systemd unit is, the unit types you will meet, and why Wants= and Requires= decide what starts while After= decides when.Writing and overriding unit filesWhere unit files live, how drop-ins change a vendor unit without editing it, and what Type=, Restart= and template units with @ really do.systemd timersSchedule jobs with a .timer and a .service: OnCalendar, catching up on missed runs with Persistent=, testing expressions, and when cron is still fine.journald and journalctlHow the systemd journal stores logs as structured, indexed entries, the journalctl filters that matter, and how persistence and disk limits work.Syslog and log rotationHow rsyslog sorts messages by facility and priority into files and to other hosts, and how logrotate keeps those files from filling the disk.Sandboxing services with systemdLimit what a compromised service can touch with DynamicUser=, ProtectSystem=, PrivateTmp= and NoNewPrivileges=, then score it with systemd-analyze security.Processes through /procRead a running process straight from the kernel: status, open files, memory maps and environment under /proc/<pid>, the D and Z states, and lsof.Scheduling, priorities and niceHow Linux shares CPUs between runnable threads, what a nice value actually buys, real-time policies with chrt, and pinning work to CPUs with taskset.Resource limits with ulimitPer-process resource limits: soft and hard values, why limits.conf does not reach systemd services, LimitNOFILE=, and fixing 'too many open files'.Memory, page cache and swapRead free and /proc/meminfo correctly, see why Linux fills RAM with page cache on purpose, and decide how much swap, swappiness and zram you want.The OOM killerWhy Linux promises more memory than it has, how the OOM killer picks a victim, reading its kernel log report, and steering it with oom_score_adj and cgroups.cgroups v2 and resource controlControl groups put processes in a tree and cap CPU, memory, I/O and process counts per branch. How v2 works and how systemd's slices drive it.NamespacesThe eight Linux namespaces, what each one hides, and how to create, inspect and enter them with unshare, lsns and nsenter.Block devices and partitionsFind disks with lsblk and blkid, read a real GPT partition table, and create aligned partitions with fdisk, sfdisk or parted without losing data.Creating filesystems: ext4, XFS and BtrfsWhat mkfs writes, how ext4, XFS and Btrfs differ in ways that matter on a server, inodes and reserved blocks, and when fsck actually runs.Mounting and fstabAttach filesystems to the directory tree with mount, make them permanent in /etc/fstab by UUID, pick the options that matter, and check before you reboot.Logical volumes with LVMPool disks into volume groups, carve flexible logical volumes, grow a mounted filesystem without downtime, and use snapshots and thin pools safely.Software RAID with mdadmRAID levels as trade-offs, building an md array with mdadm, reading /proc/mdstat, scrubbing, and replacing a failed disk without losing the array.Disk encryption with LUKSHow LUKS encrypts a block device under keyslots, the cryptsetup commands, unlocking at boot with crypttab, and TPM or network unlock in brief.Network filesystems: NFS and SMBShare directories with NFS exports, mount NFS and SMB shares with safe options, automount on demand, and recover from stale file handles.Interfaces, addresses and the ip commandRead a Linux machine's network identity with ip link and ip addr, decode names like enp5s0, and see why ifconfig was replaced.Routing and the default gatewayHow Linux picks an outgoing interface and next hop for every packet, how to ask it with ip route get, and what policy routing and IPv6 add.Name resolution on LinuxFollow a hostname through nsswitch.conf, /etc/hosts, resolv.conf and systemd-resolved, and see why getent and dig can disagree.Persistent network configurationNetworkManager, systemd-networkd and netplan: which distribution uses which, how to tell who owns an interface, and how to change it safely.Sockets and listening ports with ssFind what is listening on which address with ss -tlnp, read TCP socket states, and know when TIME_WAIT and CLOSE_WAIT are a problem.Packet filtering with nftablesWhere netfilter hooks sit in the packet path, how nftables tables, chains and rules fit together, and a default-deny server ruleset built on conntrack.Capturing traffic with tcpdumpCapture exactly the packets you need with tcpdump filters, read a TCP handshake from its flags, and save pcap files to open later in Wireshark.Hardening SSH on a serverLock sshd down to keys only, no root and named users, prove the effective config with sshd -T, and add fail2ban without locking yourself out.Firewall front ends: ufw and firewalldManage a host firewall with ufw or firewalld: default policies, zones, services, runtime versus permanent, and the nftables rules underneath.SELinuxHow SELinux labels confine services even as root, how to read a denial, and how to fix it with restorecon, booleans and port labels.AppArmorConfine programs by path with AppArmor profiles on Ubuntu and Debian: check status, read denials, switch between complain and enforce, and write a profile.Linux capabilitiesHow Linux splits root into 41 separate privileges, how to grant one with setcap or AmbientCapabilities=, and how to read a process's capability sets.Auditing with auditdRecord who touched sensitive files and what ran, with the kernel audit system: write rules, keep them in rules.d, search with ausearch and aureport.Patching and automatic updatesPatch servers with unattended-upgrades or dnf-automatic, find services still running old code with needrestart, and plan kernel reboots.Load average and the USE methodWhat Linux's load average really counts, including tasks stuck on disk, why it is not CPU usage, and how the USE method turns 'slow' into a checklist.The first sixty seconds on a slow serverTen commands in a fixed order, from uptime to top, that check every major resource on a slow Linux server in about a minute, and what to read in each.Disk and I/O bottlenecksRead iostat -x correctly, see why %util and iowait mislead on modern storage, find the process doing the I/O, and know when the I/O scheduler matters.Tracing system calls with straceWatch a program's conversation with the kernel using strace: filter with -e, follow children with -f, summarise with -c, and respect its overhead.Profiling with perf and flame graphsFind where CPU time goes with Linux perf: sample with perf top and perf record, fix missing symbols and stacks, and read a flame graph.eBPF and bpftraceWhat eBPF is, why its verifier makes in-kernel tracing safe for production, and how to use bcc tools like execsnoop and bpftrace one-liners.Recovering a system that will not bootWork out where boot stops, then fix it: edit the kernel line in GRUB, use rescue targets and rd.break, and repair from rescue media with chroot and fsck.
What Linux is
- What Linux is: the kernel and the distributionWhy "Linux" names three different things: a kernel, the userland built around it, and the distribution that packages both into a system you can install.
- Distributions and release modelsDebian, Ubuntu, the RHEL family, Arch and Alpine compared by how they release and how long they are supported, and how to pick one for a server.
- Getting a Linux machine to practice onA local VM, WSL2, a cloud instance or a container shell: what each one gives you, what it hides, and why snapshots make breaking things cheap.
- The filesystem hierarchyWhy Linux puts files where it does: /usr for the OS, /etc for config, /var for state, /run for runtime, the merged /usr, and why /tmp is now often RAM.
- Kernel space, user space and system callsThe privilege boundary every Linux program crosses, how system calls work under the C library, why some skip the kernel via the vDSO, and whose bug it is.
Boot and the kernel
- From firmware to bootloader: UEFI and GRUBWhat happens between power-on and the kernel: BIOS versus UEFI, the EFI system partition, Secure Boot with shim, regenerating GRUB's config, and systemd-boot.
- The kernel command line and initramfsHow the bootloader passes parameters to the kernel, how to read and change them, and how the initramfs finds and mounts the real root filesystem.
- systemd as PID 1 and boot targetsWhat the first process does, how systemd targets replaced runlevels, how to choose the default target, reach rescue or emergency mode, and find slow boots.
- Kernel modules and driversHow Linux loads drivers as modules on demand: lsmod, modinfo and modprobe, module options, why blacklisting is weaker than it sounds, and DKMS.
- udev and device filesWhat a device file is, what major and minor numbers mean, how udev reacts to hardware events, and why you should mount disks by UUID, not /dev/sdb.
- /proc, /sys and tuning with sysctlThe kernel's /proc and /sys as a live interface, how sysctl reads and writes /proc/sys, how sysctl.d makes changes stick, and a few knobs worth knowing.
Users and access control
- Users, groups and the account filesHow Linux identifies users and groups by number, what /etc/passwd, /etc/shadow and /etc/group hold, system versus human accounts, and NSS lookups.
- Managing accounts and passwordsCreating, changing, locking and removing accounts with useradd, usermod, passwd and chage, and the defaults in /etc/login.defs and /etc/skel behind them.
- sudo and the sudoers fileWhy admins use sudo instead of logging in as root, how sudoers rules are written and checked with visudo, drop-ins in /etc/sudoers.d, and rules that leak root.
- Special permission bits and umasksetuid, setgid and the sticky bit: how passwd edits a root-owned file, how shared directories keep their group, why /tmp is safe, and what umask does.
- Access control listsPOSIX ACLs for when owner, group and other are not enough: getfacl and setfacl, the mask that quietly limits them, default ACLs, and when a group is simpler.
- PAM and the login pathHow Linux checks a password: PAM's four module types, the stacks in /etc/pam.d, what required, requisite and sufficient do, and what runs before a shell.
Software and packages
- Packages, repositories and dependenciesWhat a package contains, how a repository's signed index ties every file to a checksum, how dependencies are resolved, and why curl | sh is a step back.
- apt and dpkgDebian and Ubuntu package management: dpkg underneath, apt on top, upgrade versus full-upgrade, holds and apt-cache policy, finding files, and deb822 sources.
- dnf and rpmPackage management on Fedora, RHEL, Rocky and Alma: rpm queries, dnf on top, where repo files live now, undoing a transaction, and what became of modules.
- Third-party repositories and signing keysHow package signatures are checked, why apt-key is gone and signed-by replaced it, adding a vendor repository safely, pinning priorities, and EPEL and PPAs.
- Snap, Flatpak and AppImageThe bundled, sandboxed package formats: what each ships, how they update and confine apps, and why they suit desktops better than servers, with exceptions.
- Shared libraries and building from sourceHow the dynamic linker finds shared libraries, what sonames are for, ldd and ldconfig, and how to build software from source without making a mess of /usr.
Services and logs
- Units, targets and dependenciesWhat a systemd unit is, the unit types you will meet, and why Wants= and Requires= decide what starts while After= decides when.
- Writing and overriding unit filesWhere unit files live, how drop-ins change a vendor unit without editing it, and what Type=, Restart= and template units with @ really do.
- systemd timersSchedule jobs with a .timer and a .service: OnCalendar, catching up on missed runs with Persistent=, testing expressions, and when cron is still fine.
- journald and journalctlHow the systemd journal stores logs as structured, indexed entries, the journalctl filters that matter, and how persistence and disk limits work.
- Syslog and log rotationHow rsyslog sorts messages by facility and priority into files and to other hosts, and how logrotate keeps those files from filling the disk.
- Sandboxing services with systemdLimit what a compromised service can touch with DynamicUser=, ProtectSystem=, PrivateTmp= and NoNewPrivileges=, then score it with systemd-analyze security.
Processes, memory and resources
- Processes through /procRead a running process straight from the kernel: status, open files, memory maps and environment under /proc/<pid>, the D and Z states, and lsof.
- Scheduling, priorities and niceHow Linux shares CPUs between runnable threads, what a nice value actually buys, real-time policies with chrt, and pinning work to CPUs with taskset.
- Resource limits with ulimitPer-process resource limits: soft and hard values, why limits.conf does not reach systemd services, LimitNOFILE=, and fixing 'too many open files'.
- Memory, page cache and swapRead free and /proc/meminfo correctly, see why Linux fills RAM with page cache on purpose, and decide how much swap, swappiness and zram you want.
- The OOM killerWhy Linux promises more memory than it has, how the OOM killer picks a victim, reading its kernel log report, and steering it with oom_score_adj and cgroups.
- cgroups v2 and resource controlControl groups put processes in a tree and cap CPU, memory, I/O and process counts per branch. How v2 works and how systemd's slices drive it.
- NamespacesThe eight Linux namespaces, what each one hides, and how to create, inspect and enter them with unshare, lsns and nsenter.
Disks, filesystems and storage
- Block devices and partitionsFind disks with lsblk and blkid, read a real GPT partition table, and create aligned partitions with fdisk, sfdisk or parted without losing data.
- Creating filesystems: ext4, XFS and BtrfsWhat mkfs writes, how ext4, XFS and Btrfs differ in ways that matter on a server, inodes and reserved blocks, and when fsck actually runs.
- Mounting and fstabAttach filesystems to the directory tree with mount, make them permanent in /etc/fstab by UUID, pick the options that matter, and check before you reboot.
- Logical volumes with LVMPool disks into volume groups, carve flexible logical volumes, grow a mounted filesystem without downtime, and use snapshots and thin pools safely.
- Software RAID with mdadmRAID levels as trade-offs, building an md array with mdadm, reading /proc/mdstat, scrubbing, and replacing a failed disk without losing the array.
- Disk encryption with LUKSHow LUKS encrypts a block device under keyslots, the cryptsetup commands, unlocking at boot with crypttab, and TPM or network unlock in brief.
- Network filesystems: NFS and SMBShare directories with NFS exports, mount NFS and SMB shares with safe options, automount on demand, and recover from stale file handles.
Networking
- Interfaces, addresses and the ip commandRead a Linux machine's network identity with ip link and ip addr, decode names like enp5s0, and see why ifconfig was replaced.
- Routing and the default gatewayHow Linux picks an outgoing interface and next hop for every packet, how to ask it with ip route get, and what policy routing and IPv6 add.
- Name resolution on LinuxFollow a hostname through nsswitch.conf, /etc/hosts, resolv.conf and systemd-resolved, and see why getent and dig can disagree.
- Persistent network configurationNetworkManager, systemd-networkd and netplan: which distribution uses which, how to tell who owns an interface, and how to change it safely.
- Sockets and listening ports with ssFind what is listening on which address with ss -tlnp, read TCP socket states, and know when TIME_WAIT and CLOSE_WAIT are a problem.
- Packet filtering with nftablesWhere netfilter hooks sit in the packet path, how nftables tables, chains and rules fit together, and a default-deny server ruleset built on conntrack.
- Capturing traffic with tcpdumpCapture exactly the packets you need with tcpdump filters, read a TCP handshake from its flags, and save pcap files to open later in Wireshark.
Security and hardening
- Hardening SSH on a serverLock sshd down to keys only, no root and named users, prove the effective config with sshd -T, and add fail2ban without locking yourself out.
- Firewall front ends: ufw and firewalldManage a host firewall with ufw or firewalld: default policies, zones, services, runtime versus permanent, and the nftables rules underneath.
- SELinuxHow SELinux labels confine services even as root, how to read a denial, and how to fix it with restorecon, booleans and port labels.
- AppArmorConfine programs by path with AppArmor profiles on Ubuntu and Debian: check status, read denials, switch between complain and enforce, and write a profile.
- Linux capabilitiesHow Linux splits root into 41 separate privileges, how to grant one with setcap or AmbientCapabilities=, and how to read a process's capability sets.
- Auditing with auditdRecord who touched sensitive files and what ran, with the kernel audit system: write rules, keep them in rules.d, search with ausearch and aureport.
- Patching and automatic updatesPatch servers with unattended-upgrades or dnf-automatic, find services still running old code with needrestart, and plan kernel reboots.
Performance and troubleshooting
- Load average and the USE methodWhat Linux's load average really counts, including tasks stuck on disk, why it is not CPU usage, and how the USE method turns 'slow' into a checklist.
- The first sixty seconds on a slow serverTen commands in a fixed order, from uptime to top, that check every major resource on a slow Linux server in about a minute, and what to read in each.
- Disk and I/O bottlenecksRead iostat -x correctly, see why %util and iowait mislead on modern storage, find the process doing the I/O, and know when the I/O scheduler matters.
- Tracing system calls with straceWatch a program's conversation with the kernel using strace: filter with -e, follow children with -f, summarise with -c, and respect its overhead.
- Profiling with perf and flame graphsFind where CPU time goes with Linux perf: sample with perf top and perf record, fix missing symbols and stacks, and read a flame graph.
- eBPF and bpftraceWhat eBPF is, why its verifier makes in-kernel tracing safe for production, and how to use bcc tools like execsnoop and bpftrace one-liners.
- Recovering a system that will not bootWork out where boot stops, then fix it: edit the kernel line in GRUB, use rescue targets and rd.break, and repair from rescue media with chroot and fsck.