Pick a Free OS

User login

Navigation

Securing Linux: Part 2

services then we suggest that you disable those services rather than have

unknown loopholes in those daemons cause trouble.

Another place to check for the running services are through the "inetd"

daemon which can be configured through /etc/inetd.conf. To disable any

service running through the inetd daemon just comment out the particular

line. Also depending on the runlevel your machine is running various

startup scripts you will find the symlinks to them in /etc/rc.d/rc*

directories in any Linux distribution.

Take for instance runlevel 3 on the SuSE linux distribution, which is

multi-user with network and Xwindows. The startup scripts for this runlevel

are located in /etc/rc.d/rc3.d. Thus by adding or removing any symbolic

links in this particular directory one can add or remove any services in

this runlevel. The same holds true for the various runlevels and the

startup scripts for that are located in the /etc/rc.d/rc*d directories.

To edit these services in RedHat, use the "chkconfig" utility, which is

implemented using the following parameters.

bash# chkconfig --list <-- Lists all the services configured to run in

this runlevel.

bash# chkconfig --del service_name <-- To delete a service in a

particular runlevel.

On SuSE this can be accomplished by using the tool YaST. The procedure is

as follows, run the command "yast" as root. Enter System Administration -->

Change Configuration File --> Services to be started at boot.

Alternatively you could also edit /etc/rc.config by hand and run the script

"SuSEconfig". If you are a novice, you would be better of sticking with

YaST.

Using TCP wrappers

On many Linux distributions, the inetd daemon is used to start various

other services on the Linux machine. Let's see how the inetd daemon works.

The inetd daemon is started normally from the /etc/rc.d/init.d/inetd

startup script. The location of this script may differ among distributions.

The inetd daemon works by accepting connections for other services and then

redirecting the connection to the respective service. This is done by

spawning a new process of the service wanted. There are various pros and

cons to starting services through the inetd daemon, but we won't discuss

any of those over here. Some of the most common services that can be

started through the inetd daemon are nntp, smtp, pop, time, talk and smb.