 |
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.
- First, decide which service you want to turn off. For the sake of
discussion, call it chargen.
- su. Enter your root password.
- vi /etc/inetd.conf (or use your favorite editor).
- Search for chargen (at the beginning of a line).
- Comment this line, by inserting a "#" character at the beginning of the line.
- Save this file (/etc/inetd.conf), and exit your editor.
- 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
- ps -ef | grep inetd
- 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
- 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.
- 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)
- ps auxww | grep inetd
- 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
- 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.
- 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)
- /usr/sbin/inetd
- Tru64 UNIX
- ps -ef | grep inetd
- 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
- 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.
- 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
- ps -ef | grep inetd
- 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
- 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.
- 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)
- /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
|