Practical steps to make a systemd unit impossible to start, with clear examples and caveats. 29.01.2026 | reading time: 2 min Masking a systemd service makes it impossible to start or enable the unit by linking the unit name to /dev/null; this is stronger than disable and useful to enforce a hard block. Why mask it? Use masking when you must ensure a unit never runs, even indirectly via dependencies or accidental enable; unlike disable, which only prevents automatic start, mask guarantees any attempt to start the unit fails until explicit unmasking. Hands-on example ```sudo systemctl mask myservice.service Created symlink /etc/systemd/system/myservice.service -> /dev/null sudo systemctl start myservice.service Failed to start myservice.service: Unit myservice.service is masked. sudo systemctl status myservice.service ● myservice.service Loaded: masked (/dev/null) Active: inactive (dead) ``` Options and caveats Remember that `systemctl mask` only affects the named unit; socket-activated or template-based units may require masking of related sockets or templates, use `--now` to stop immediately when masking, and use `systemctl unmask` to restore normal behavior; masking does not remove unit files and root access is required. Related commands to know Pair masking with `systemctl disable` for intent, check logs with `journalctl -u myservice.service`, and inspect unit resolution with `systemctl cat` or `systemctl status` to verify the symlink to /dev/null. Final thought Masking is a blunt and reliable administrative tool to prevent any activation of a service; learn it well and consider deeper certification paths like CompTIA Linux+ or LPIC-1, and prepare intensively at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. boot-process processes security utilities