Linux 101 : System security - Disabling unused services - Systemctl -
When we are running a system, stopping or disabling unused services could save resources, it also makes our system safer.
Displaying all the services on a system:
All the services with a plus sign [+], are running services, and all the services with a minus sign [-], are stopped services.
We could also use "systemctl" to list all the services
We can stop a service using the below command:
We check if it was stopped:
Displaying enabled services:
Enabled services start at boot-time. We display them using:
Disabling a service:
The syntax to disable a service, so it doesn't start when the system boots is as below:
We check the status of the service (if it was disabled) using the below:
Checking the failed services:
We can check the "health" of services using: