ZDNet UK


Skip to Main Content

  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Jobs
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


Network management Toolkit

Improve Linux security

Mary Ann Richardson

Published: 08 Oct 2002 10:39 BST

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

The results are also shown in Figure B. You'll notice that they are significantly different from the results shown in Figure A. Unlike in inetd, this command will not show you which services xinetd is listening for. To see those services, you must list the files in the /etc/xinetd.d directory, which is the equivalent of the /etc/inetd.d directory used by inetd. To do so, enter the command:ls -l /etc/xinetd.d/*

Figure C

The results, shown in Figure C, indicate which services xinetd is listening for. To turn off a service you don't want xinetd to run, you need to edit the file for that particular service. For example, to turn off talk, you would edit the /etc/xinetd.d/talk file using vi or another text editor, so that disable equals yes, as shown in Figure D. Note that you will need to restart xinetd for any configuration changes to take effect.

Figure D

Services not run by the inetd or xinetd daemons
While the configuration files of the inetd and xinetd daemons are useful in determining which network services have been started by these super daemons, not all network services are or should be under their control. Increasingly, network services are being configured to start independently at system startup. Their startup scripts can be found in the /etc/rc.d directory. To access this directory and view a listing, open a terminal window and enter the following commands:cd /etc/rc.dls -l rc*.d

Figure E

As Figure E shows, the /etc/rc.d directory contains seven subdirectories of start scripts that are invoked by the init process as the system enters the designated runlevel. For example, upon startup, a Red Hat workstation installed with X-Windows defaults to runlevel 5; init looks in the /etc/rc.d/rc5.d directory and runs each start script it finds listed there. If you press [Ctrl][Alt][F1] as root, you will be returned to the text-based login screen, or runlevel 3, at which level init will run the scripts found in rc3.d. To identify the scripts that will run under a particular runlevel, such as 3, enter the following command:cd rc3.dls -l

Figure F

Note that the partial listing of rc3.d shown in Figure F does not contain the actual scripts themselves, but symbolic links to them which are located in the /etc/r.d/init.d directory.

As with stand-alone systems connected to the Internet, the ps command should be executed upon booting your system to see which daemons have actually been started. (Note that even though a script is supposed to run at a particular runlevel, it may not if the script requires a certain configuration that doesn't exist on your system.) If you don't want a specific service to run, you must find and delete the link to its start script from its corresponding /etc/rc*.d directory. Many Linux distributions include graphical system tools (e.g., Linuxconf or YaST) that can be used to stop unnecessary services without having to delete the scripts manually.

Determine what's running now
After you have made changes to the inedt or xinedt configuration files and the rc.d directories, how can you be sure all unnecessary network services have been stopped? It is a good idea to run the netstat utility any time changes are made to the configuration files and upon reboot. To find out which ports are currently awaiting connections, enter netstat with the --inet and -a options, as shown in Figure G.

Figure G

Only by examining the output from the netstat command can you be sure that the changes you made have taken effect and that your system ports are not open to active services.


Have your say instantly in the
Tech Update forum.

Find out what's where in the new Tech Update with our
Guided Tour.

Let the editors know what you think in the
Mailroom.

Next

Previous

1 2


  • Email
  • Trackback
  • Clip Link
  • Print friendlyPrint with Konica

Did you find this article useful?
106 out of 215 people found this useful


Full Talkback thread

0 comments


Company/Topic Alerts

Create a new alert from the list below:














On The Road Blog

HTC G1 Camera Phone

Now for some years, I have noticed that HTC doesn't make very good camera phones. They have been trying to shed some light on why it takes such gawdawful pictures but I don't think... More

Post a comment

Sony Ericsson Xperia X1

Phones are not my usual choice of bloging material but this phone really did impress me! The superb webpage video episode layout does a good job to show you what's possible with windows... More

2 comments

Mysterious black radio ops in London

I had just popped out of our Southwark offices for a moment at lunchtime when a most peculiar vehicle swanned past. It was a shiny black Ford Mondeo estate, but the roof was studded... More

9 comments