With systemd, managing and checking services is easier than ever, here’s how to list the active services on your system.
sudo systemctl unmask
Final Thoughts
When you install Linux, the OS typically enables several services automatically. For example, you might end up with web servers, FTP servers, print servers, or network services running without you asking for them. But if your server doesn’t need those, they’re just wasting CPU, memory, and opening attack surfaces.
sudo systemctl list-units –type=service –state=running
sudo ss -tuln
OR
sudo netstat -tuln
If you find something you don’t need, you can stop it and prevent it from starting again:
List all Running Services
In this article, we’ll walk through how to identify and disable unnecessary services on systemd-based Linux distributions like Fedora, CentOS, Ubuntu, Debian, and others.
Here’s a list of frequently running services you can review. If you don’t use what they support, disable them.
Check Open Ports and Identify Listening Services
Only enable the services that support your server’s purpose.
Not sure what’s running on your system or what starts up automatically? Here are some easy commands to help you figure that out:
Common Unnecessary Services on systemd Systems
sudo systemctl disable avahi-daemon
sudo systemctl disable bluetooth
sudo systemctl disable iscsi
sudo systemctl disable iscsid.socket
sudo systemctl disable iscsiuio.socket
sudo systemctl disable lvm2-monitor
sudo systemctl disable lvm2-lvmpolld.socket
sudo systemctl disable mdmonitor
sudo systemctl disable raid-check.timer
sudo systemctl disable qemu-guest-agent
sudo systemctl disable nfs-convert
sudo systemctl disable nfs-client.target
sudo systemctl disable cups
sudo systemctl disable postfix
sudo systemctl disable sssd
sudo systemctl disable hyperv-daemons
sudo systemctl disable apport
sudo systemctl disable zeitgeist
sudo systemctl disable telepathy
Use the commands below to disable the services listed above:
Service | Description |
---|---|
avahi-daemon |
Zero-configuration networking (local service discovery). |
bluetooth.service |
Manages Bluetooth — useless on headless servers. |
iscsi.service , iscsid.socket , iscsiuio.socket |
For iSCSI network storage. |
lvm2-monitor.service , lvm2-lvmpolld.socket |
For managing LVM volumes. |
mdmonitor.service , raid-check.timer |
Related to software RAID. |
qemu-guest-agent.service |
Only useful if you’re running inside a QEMU/KVM VM. |
nfs-convert.service , nfs-client.target |
For NFS (networked file systems). |
cups.service |
Printing services — likely useless on a server. |
postfix.service |
Mail server — unnecessary unless you’re sending mail. |
sssd.service |
Connects to domains like LDAP or AD. |
hyperv-daemons |
Only needed inside Hyper-V virtual machines. |
apport.service |
Ubuntu’s error reporting tool. |
zeitgeist , telepathy |
Desktop logging and messaging services — not for servers. |
sudo systemctl stop # Stops the service now
sudo systemctl disable # Prevents it from starting at boot
To list all enabled services and set them to start when your system boots.
How to Identify and Review Services
Remember, a lean server is a fast server. Take control of what runs on your system. Keep your server focused on the job it was built for.
systemd-analyze blame
Not every service that runs on your Linux machine is something you actually need. Depending on whether you’re using your system as a desktop, server, or virtual machine, many services might be running in the background – quietly hogging memory, CPU, or even opening security holes.
When you build a server according to your plan and requirements, you want it to run quickly and efficiently, right? But did you know that modern Linux systems, especially those using systemd, often install and run many services by default, even if you don’t need them? These unwanted services consume precious system resources and can even become security risks.
systemctl list-units –type=service
To see which services are actively listening for network connections on your server, use one of the following commands: ss or netstat.
Before disabling services, ask yourself:
systemctl list-unit-files –type=service –state=enabled
To list all active and running services, you can use the following systemctl command.
sudo systemctl mask
If you ever want to bring it back: