Problem solve Get help with specific problems with your technologies, process and projects.

Deciding which services in inetd can be disabled

Deciding which services in inetd can be disabled

In securing Unix systems, one of the first items people generally recommend is to disable services in /etc/inetd.conf...

that are not needed. Unfortunately, it's often not clear which services are needed and which are not. The following tip can help with that.

The basic assumption here is that when your system is backed up the last access time of the binaries used by inetd get updated (along with all other files on the system). The last access time of a binary is also updated each time inetd opens that binary to provide a given service.

To take advantage of this, we first create a file somewhere that no one has a reason to open (e.g. /etc/flagfile). Now, let the machine sit for awhile (how long depends on your environment). Probably at least one full backup cycle.

Next run the attached code. This will list the last access time of all binaries used in /etc/inetd.conf -- you'll need to add a line to do the same "ls -lLu" on your flagfile.

Now, look over the output for services that show a last access time that's different from your flag file. Now you know that service is in use.

Of course, you need to repeat this process over a large enough period of time to get good data. Running it right before your backups begin will give you the best results.

Why people are using some of the services it finds is another exercise...

for i in `grep -v ^# /etc/inetd.conf | awk '{print $6}'`; do
if [ $i = "internal" ]; then
ls -lLu $i

# Change this to your own flag file
ls -lLu /etc/flagfile

This was last published in November 2001

Dig Deeper on IPv6 security and network protocols security

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.