Sunday, May 30, 2010

Removing Unwated Services on Debian systems

In this post, I am going to detail to you the required steps in making your debian system remove unwanted services.  These services may or may have unwanted security implications especially if you decide to freeze the system you are working on.  The concept of freezing means you will have to lock-down all updates to the system due to a very critical application requirement. 

Under Debian Linux startup files are stored in /etc/init.d/ directory and symbolic linked between /etc/rcX.d/ directory exists. Debian Linux uses System V initialization scripts to start services at boot time from /etc/rcX.d/ directory. Debian Linux comes with different utilities to remove unwanted startup file


Using rcconf
This tool configures system services in connection with system runlevels. It turns on/off services using the scripts in /etc/init.d/. Rcconf works with System-V style runlevel configuration. It is a TUI(Text User Interface) frontend to the update-rc.d command.

Install rcconf in Debian
#apt-get install rcconf
To start rconf, login as root user and type rcconf
# rcconf
Select the service you would like to enable or disable.

Using sysv-rc-conf

sysv-rc-conf provides a terminal GUI for managing “/etc/rc{runlevel}.d/” symlinks. The interface comes in two different flavors, one that simply allows turning services on or off and another that allows for more fine tuned management of the symlinks. Unlike most runlevel config programs, you can edit startup scripts for any runlevel, not just your current one.

Install sysv-rc-conf in debian

#apt-get install sysv-rc-conf
This will install sysv-rc-conf.Now you need to run the following command
# sysv-rc-conf
Select the service you would like to enable or disable.
Both sysv-rc-conf and rcconf are best tools to use on Remote Debian Linux or when GUI is not available
You can also use update-rc.d script as follows (update-rc.d removes any links in the /etc/rcX.d directories to the script /etc/init.d/service):
# update-rc.d -f {SERVICE-NAME} remove
For example to stop xinetd service you can type command as follows:
# update-rc.d -f xinetd remove

No comments:

Post a Comment