Network & Academic Computing Services
Security


Turning off an inetd-launched service


This document describes how to turn off a specific service that is launched by inetd. It does not describe how to turn off inetd itself.

  1. First, decide which service you want to turn off. For the sake of discussion, call it chargen.
  2. su. Enter your root password.
  3. vi /etc/inetd.conf (or use your favorite editor).
  4. Search for chargen (at the beginning of a line).
  5. Comment this line, by inserting a "#" character at the beginning of the line.
  6. Save this file (/etc/inetd.conf), and exit your editor.
  7. Next, we have to tell inetd to reread /etc/inetd.conf. The way of doing this varies from UNIX variant to the next. Some of the ways are described below.
  • Solaris 2
      1. ps -ef | grep inetd
      2. You can expect to see output like:
          root 140 1 0 Aug 19 ? 0:02 /usr/sbin/inetd -s
          root 24366 816 0 09:21:03 pts/7 0:00 grep inetd
      3. The line ending in inetd is the line that identifies the pid (or "process id") of inetd. The second column is the pid number itself, or in this case, 140. Ignore the line ending with the grep inetd; it's part of the command that you just issued.
      4. kill -HUP 140 (be sure to fill in the pid from step 3 - don't just use 140 unless that's what your ps -ef | grep inetd identified too)

  • Red Hat Linux (and perhaps other distributions as well)
      1. ps auxww | grep inetd
      2. You can expect to see output like:
          root 187 0.0 1.7 932 404 ? S 09:32 0:00 inetd
          root 494 0.0 1.5 1020 344 p0 S 09:34 0:00 grep inetd
      3. The line ending in inetd is the line that identifies the pid (or "process id") of inetd. The second column is the pid number itself, or in this case, 187. Ignore the line ending with the grep inetd; it's part of the command that you just issued.
      4. kill -9 187 (be sure to fill in the pid from step 3 - don't just use 187 unless that's what your ps -ef | grep inetd identified too)
      5. /usr/sbin/inetd

  • Tru64 UNIX
      1. ps -ef | grep inetd
      2. You can expect to see output like:
          root 464 1 0.0 Aug 04 ?? 0:25.28 /usr/sbin/inetd
          root 17095 26083 0.0 09:36:02 ttypf 0:00.02 grep inetd
      3. The line ending in inetd is the line that identifies the pid (or "process id") of inetd. The second column is the pid number itself, or in this case, 464. Ignore the line ending with the grep inetd; it's part of the command that you just issued.
      4. kill -HUP 464 (be sure to fill in the pid from step 3 - don't just use 464 unless that's what your ps -ef | grep inetd identified too)

  • IRIX
      1. ps -ef | grep inetd
      2. You can expect to see output like:
          root 4803 1 0 13:41:52 ? 0:03 /usr/etc/inetd
          root 8071 8053 0 09:32:46 pts/11 0:00 grep inetd
      3. The line ending in inetd is the line that identifies the pid (or "process id") of inetd. The second column is the pid number itself, or in this case, 4803. Ignore the line ending with the grep inetd; it's part of the command that you just issued.
      4. kill -9 4803 (be sure to fill in the pid from step 3 - don't just use 4803 unless that's what your ps -ef | grep inetd identified too)
      5. /usr/etc/inetd

  • If your UNIX variant isn't listed, you can probably use one of the methods described above, or you might want to contact your local UNIX support people for help.
Consider testing the service you just turned off. You could do this by running the client program that is intended to use the service. It should refuse to do its job now. Alternatively, if this is a TCP service, you can say telnet localhost chargen (to test if chargen is on or off, for example). If the service is turned off, you should get "connection refused". If telnet says "Connected to localhost", then something went wrong; you probably want to go back to the beginning of these instructions and try again, or call your local UNIX support people for assistance. If you do see "Connected to localhost", you can get out by saying "^]quit", where "^]" is control-right-square-bracket.



dcs@uci.edu

Network & Academic Computing Services > Support > Security > Securing a UNIX Machine

Updated: August 6, 2003

University of California, Irvine