Objective. Students use systemd to manage services and reduce the attack surface of a Linux server by disabling unnecessary daemons and applying CIS Benchmark controls.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Every program running on a Linux server is a potential entry point for an attacker. The attack surface is the total set of points where an unauthorized user could try to enter or extract data. One of the most effective ways to shrink the attack surface is to stop running software you do not need. This lesson focuses on how Linux starts its services and how you use systemd to turn off the ones that should not be running.
Modern Linux distributions — including Ubuntu, Debian, Fedora, and RHEL-family systems — use systemd as the first process started by the kernel (PID 1). systemd reads unit files stored in `/lib/systemd/system/` and `/etc/systemd/system/`, then brings targets up in order. Key milestones are:
1. sysinit.target — mounts file systems, initializes the kernel, starts `systemd-journald` (the logging daemon).
2. basic.target — starts sockets, timers, and other low-level units.
3. network-online.target — waits until at least one network interface is fully configured before dependent services start.
4. multi-user.target — starts most server daemons (SSH, cron, web servers, etc.) and getty units that provide console login prompts.
5. graphical.target — adds a display manager if a GUI is installed (generally absent on servers).
Understanding this sequence matters because attackers who gain a foothold often plant persistence mechanisms that hook into one of these targets so their code survives a reboot.
Every enabled service:
Disabling a service you do not use costs nothing in capability and reduces all four risks simultaneously.
The Center for Internet Security (CIS) publishes free benchmarks for major Linux distributions. The CIS Ubuntu Linux Benchmark lists specific services that should be disabled on a general-purpose server — for example, `avahi-daemon` (zero-configuration networking, unnecessary in most server environments), `cups` (print service), `isc-dhcp-server`, `nfs-server`, `rpcbind`, and others. The benchmark assigns each control a level (Level 1 = practical minimum; Level 2 = high-security environments) and explains the rationale. Always cross-reference the benchmark against your organization's actual needs before disabling anything in production.
`systemctl` is the command-line tool for interacting with systemd. Core operations:
| Goal | Command |
|---|---|
| List all running services | `systemctl list-units --type=service --state=running` |
| Show service status | `systemctl status <service>` |
| Stop a service immediately | `systemctl stop <service>` |
| Prevent it from starting on boot | `systemctl disable <service>` |
| Do both at once | `systemctl disable --now <service>` |
| Confirm it is truly off | `systemctl is-enabled <service>` and `systemctl is-active <service>` |
After a reboot, re-run `is-enabled` and `is-active` for every service you disabled. If a service is still active after a reboot, something else may have re-enabled it — which is itself a red flag worth investigating.
The MITRE ATT&CK framework documents real-world adversary tactics and techniques. Tactic TA0003 (Persistence) covers how attackers ensure their access survives reboots and credential changes. Three systemd-related persistence points are frequently abused:
Always verify unit file contents in `/etc/systemd/system/` and watch for unit files you did not create.
Although cybersecurity work is performed in a digital environment rather than a physical shop, professional safety discipline still applies:
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.
Does the school offer financial aid?
No. We don’t offer financial aid because we’re free. No, really: completely free.
Do you offer industry certification?
No. We are not certified yet, so we can’t offer that to students. What we do offer is knowledge and understanding of a trade.
Enroll first in the trade you’re interested in. You get your key, your program opens, and you begin studying.
Enroll free →