Controlling System Services
In Linux, essential functions (like web servers, SSH access, or database management) run as background processes called services or daemons. Modern Linux distributions use the systemd init system, controlled primarily by the systemctl utility.
Key systemctl Commands
| Command | Function |
|---|---|
systemctl status <service> | Check if a service is running and view recent logs. |
systemctl start <service> | Start a service (e.g., apache2). |
systemctl stop <service> | Stop a service. |
systemctl restart <service> | Stop and then start a service. |
systemctl enable <service> | Configure the service to start automatically at boot. |
systemctl disable <service> | Prevent the service from starting at boot (a key hardening technique). |
Security Relevance: Attackers might try to stop logging services or enable malicious services. Defenders use these commands to ensure only necessary services are running (Principle of Least Privilege).