[SOLVED]Disabling unnecessary services
[SOLVED]Disabling unnecessary services
Welcome. If such a topic already exists, please feel free to redirect it. It is about services. I would like to disable the ones that listen unnecessarily, such as avahi-daemon, or sshd, inted, rpcbind. How can I achieve this without harming the system? Thank you very much in advance for any tips
Last edited by Marek on Mon Jul 11, 2022 1:58 pm, edited 1 time in total.
Re: Disabling unnecessary services
The easiest way without installing anything is is enabling and disabling things in the Session Startup utility, which version of MX are you using (ie XFCE, KDE or Fluxbox)?
Re: Disabling unnecessary services
No no. The services listed, are generally not applications, as such. They are not included in the autostart. Their startup scripts, are located in /etc/init.d. I'm slowly starting to explore the topic, because there is a lot of instructions and documentation for Debian, you just need to know how to look for it, and with me, there is trouble sometimes 

Re: Disabling unnecessary services
I haven't used it in years but there was an ncurses utility called rcconf (or something like that)..
I see in Synaptic there is a utility called sysv-rc-conf which is a terminal based utility for services etc... Might be worth investigating..?
I see in Synaptic there is a utility called sysv-rc-conf which is a terminal based utility for services etc... Might be worth investigating..?
Re: Disabling unnecessary services
One of the things I do after an installation is to disable services that I will never need.
The below code window shows four ways I use to view the status of a service. All of these commands are installed by default in MX-18, 19 and 21.
The first command will show the status of all the services.
The second will show the status of one service.
The third shows the status of only enabled services.
The fourth (sysv-rc-conf) will show services in a SysV runlevel configuration table. The arrow keys are used to select run levels that a particular service will run, but may be a little more difficult for removing a service because all the enabled levels will have to be toggle off.
I use the following command to disable a service from all run levels:
To add, disable, enable, or remove a service with update-rc.d:
While you said you were interested in removing services that "listen unnecessarily" I though you might be interested in the services that I disabled (MX-18, 19, and 21) because I have no need for them:
avahi-daemon (I don't use printers)
bluetooth (I don't use bluetooth)
cups (I don't use printers)
cups-browsed (I don't use printers)
*nfs-common (I don't have a NFS)
nfs-kernel-server (I don't have a NFS)
nmbd (I don't use samba)
pppd-dns (I don't use dial-up Internet)
*rpcbind (I don't use NFS)
*saned (I don't have a scanner)
smbd (I don't use samba)
* These required a reboot for the disabled status to show.
The below code window shows four ways I use to view the status of a service. All of these commands are installed by default in MX-18, 19 and 21.
The first command will show the status of all the services.
The second will show the status of one service.
The third shows the status of only enabled services.
The fourth (sysv-rc-conf) will show services in a SysV runlevel configuration table. The arrow keys are used to select run levels that a particular service will run, but may be a little more difficult for removing a service because all the enabled levels will have to be toggle off.
Code: Select all
sudo service --status-all
sudo service <service> status
systemctl list-unit-files --type=service --state=enabled
sudo sysv-rc-conf
I use the following command to disable a service from all run levels:
Code: Select all
sudo update-rc.d <service> disable
Code: Select all
sudo update-rc.d <service> defaults (add service)
sudo update-rc.d <service> disable (disable service with init script available)
sudo update-rc.d <service> enable (enable service)
sudo update-rc.d <service> remove (remove service)
While you said you were interested in removing services that "listen unnecessarily" I though you might be interested in the services that I disabled (MX-18, 19, and 21) because I have no need for them:
avahi-daemon (I don't use printers)
bluetooth (I don't use bluetooth)
cups (I don't use printers)
cups-browsed (I don't use printers)
*nfs-common (I don't have a NFS)
nfs-kernel-server (I don't have a NFS)
nmbd (I don't use samba)
pppd-dns (I don't use dial-up Internet)
*rpcbind (I don't use NFS)
*saned (I don't have a scanner)
smbd (I don't use samba)
* These required a reboot for the disabled status to show.
- anticapitalista
- Developer
- Posts: 4315
- Joined: Sat Jul 15, 2006 10:40 am
Re: Disabling unnecessary services
You can disable/enable at install time too.
anticapitalista
Reg. linux user #395339.
Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - lean and mean.
https://antixlinux.com
Reg. linux user #395339.
Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - lean and mean.
https://antixlinux.com
Re: Disabling unnecessary services
Great info!
Re: Disabling unnecessary services
Thank you very much for your help. I was able to disable the listening services. Only the network-manager at the connection remained. @AVLinux Thank you for pointing out the tool in cli. @Stuart_M Thank you very much for such a comprehensive answer. It explains a lot. @anticapitalista Yes I disable some services at the installer level, but a few need to be disabled otherwise though. Thank you all very much!